setuplampubuntu22
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
setuplampubuntu22 [2025/04/28 22:20] – created tektinkers | setuplampubuntu22 [2025/04/29 00:26] (current) – tektinkers | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Commands | + | [[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' |
- | 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 |
</ | </ | ||
+ | </ | ||
- | To: | + | __To:__ |
+ | < | ||
< | < | ||
- | | + | DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm |
</ | </ | ||
+ | </ | ||
- | sudo systemctl restart apache2 | + | < |
- | sudo systemctl status apache2 | + | < |
- | Installing other PHP Packages: | + | //Installing other PHP Packages:// |
- | 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:// |
+ | < | ||
< | < | ||
ServerName your_domain | ServerName your_domain | ||
Line 56: | Line 65: | ||
CustomLog ${APACHE_LOG_DIR}/ | CustomLog ${APACHE_LOG_DIR}/ | ||
</ | </ | ||
+ | </ | ||
- | 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.1745878826.txt.gz · Last modified: 2025/04/28 22:20 by tektinkers