setuplampubuntu22
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
setuplampubuntu22 [2025/04/28 22:24] – tektinkers | setuplampubuntu22 [2025/04/29 00:26] (current) – tektinkers | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Commands to Setup a LAMP server in Ubuntu 22. | + | [[https:// |
- | ====== | + | [[https:// |
- | **Installing Apache** | + | ====== Commands to Setup a LAMP server in Ubuntu 22. ====== |
- | sudo apt update | + | **Installing Apache** |
- | sudo apt install apache2 | + | < |
- | sudo ufw app list | + | < |
- | sudo ufw allow in " | + | < |
- | sudo ufw status | + | < |
+ | < | ||
//Check Website' | //Check Website' | ||
Line 14: | Line 15: | ||
**Installing MySQL** | **Installing MySQL** | ||
- | sudo apt install mysql-server | + | < |
- | sudo mysql | + | < |
- | ALTER USER ' | + | //change " |
- | exit | + | < |
- | sudo mysql_secure_installation | + | < |
+ | < | ||
**Installing PHP** | **Installing PHP** | ||
- | sudo apt install php libapache2-mod-php php-mysql | + | < |
- | php -v | + | < |
- | sudo nano / | + | < |
//Change:// | //Change:// | ||
+ | < | ||
+ | < | ||
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm | DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm | ||
+ | </ | ||
+ | </ | ||
__To:__ | __To:__ | ||
+ | < | ||
+ | < | ||
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm | DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm | ||
+ | </ | ||
+ | </ | ||
- | sudo systemctl restart apache2 | + | < |
- | sudo systemctl status apache2 | + | < |
// | // | ||
- | sudo apt install php-cli | + | < |
**Creating a Virtual Host for Apache** | **Creating a Virtual Host for Apache** | ||
- | sudo mkdir / | + | //Change " |
- | sudo chown -R $USER:$USER / | + | < |
- | sudo nano / | + | < |
+ | < | ||
//Copy / Paste into blank file:// | //Copy / Paste into blank file:// | ||
- | >< | + | <code> |
+ | < | ||
ServerName your_domain | ServerName your_domain | ||
ServerAlias www.your_domain | ServerAlias www.your_domain | ||
Line 52: | Line 64: | ||
ErrorLog ${APACHE_LOG_DIR}/ | ErrorLog ${APACHE_LOG_DIR}/ | ||
CustomLog ${APACHE_LOG_DIR}/ | CustomLog ${APACHE_LOG_DIR}/ | ||
- | </ | + | </ |
+ | </code> | ||
- | sudo a2ensite your_domain | + | < |
- | sudo a2dissite 000-default | + | < |
- | sudo apache2ctl configtest | + | < |
- | sudo systemctl reload apache2 | + | < |
**MySQL: Creating Users and Databases** | **MySQL: Creating Users and Databases** | ||
- | CREATE DATABASE example_database; | + | //Change " |
- | CREATE USER ' | + | < |
+ | < | ||
- | //Change password of users:// | + | //OPTIONAL - Change password of users:// |
- | ALTER USER ' | + | < |
- | GRANT ALL ON example_database.* TO ' | + | < |
- | exit | + | < |
+ | \\ | ||
+ | \\ | ||
+ | \\ | ||
+ | Credit to: [[https:// |
setuplampubuntu22.1745879056.txt.gz · Last modified: 2025/04/28 22:24 by tektinkers