Last active
April 26, 2021 09:13
-
-
Save fawad4real/3d39a420766dc57ad1246c633745e6fe to your computer and use it in GitHub Desktop.
Cmds to Install LAMP and WordPress on Ubuntu Server 18.04.xx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note : This gist do not tell you how to install ubuntu server , all the steps are after the installation. | |
INSTALL LAMP USING TASKSEL | |
__________________________ | |
1) Check the ip to see if OS is connected to internet : ifconfig | |
// if proper ip is not obtained then check your network settings. | |
2) Install tasksel (to install LAMP): sudo apt-get install tasksel | |
3) Run tasksel (Install lamp from tasksel using Spacebar then hit Enter) : sudo tasksel | |
4) Now check the status of apache2 : sudo service apache2 status | |
// it should say active ( Running ) | |
5) Goto cd /tmp | |
INSTALL WORDPRESS , UNZIP & INSTALL WORDPRESS | |
_____________________________________________ | |
6) Install wordpress from their website : sudo wget www.wordpress.org/latest.zip | |
7) Install UNZIP to unzip the zip file of wordpress: sudo apt-get install unzip | |
8) Then Unzip wordpress : sudo unzip latest.zip | |
) touch /tmp/wordpress/.htaccess | |
) mkdir /tmp/wordpress/wp-content/upgrade | |
9) Copy path to apache( move the wordpress folder from /tmp to apache /html folder): sudo cp -r wordpress /var/www/html/ | |
10) Check : cd var/www/html/ | |
:ls // ls should show the folder of wordpress in html folder | |
Create database in MYSQL | |
__________________________ | |
11) Enter Mysql : Sudo mysql | |
12) Create database : create database wp_databaseame_com DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; | |
13) Create a user : create user ‘fawad’@’localhost’ identified by ‘admin123’ ; | |
14) Grant privileges to user : grant all privileges on wordpress.* to ‘fawad’@’localhost’ identified by ‘admin123’; | |
15) Flush : flush privileges ; // to release the privileges | |
EXIT; | |
Open wordpress and connect database: | |
____________________________________ | |
EDIT /etc/apache2/sites-available/ | |
sudo nano /etc/apache2/sites-available/bitprimate.com.conf | |
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
ServerName bitprimate.com | |
ServerAlias www.bitprimate.com | |
DocumentRoot /var/www/bitprimate.com | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
</VirtualHost> | |
sudo a2ensite bitprimate.com.conf | |
____________________________________ | |
GIVE 755 access to wordpress folder | |
sudo chown -R $USER:$USER /var/www/html/wordpress | |
sudo chmod -R 755 /var/www/html/wordpess | |
sudo chown -R www-data:www-data /var/www/html/wordpress | |
sudo find /var/www/html/wordpress/ -type d -exec chmod 750 {} \; | |
sudo find /var/www/html/wordpress/ -type f -exec chmod 640 {} \; | |
____________________________________ | |
16) Open path: Cd var/www/html/wordpress/ | |
17) Change name of wp-config-sample.php : sudo cp wp-config-sample.php wp-config.php | |
18) Open file : sudo nano wp-config.php // this will open editor to edit the php file | |
//Change databse_ name , username and password ; | |
Set apache path | |
_________________ | |
//change the path for apache to read from worpress not from html folder. | |
19) Enter path : cd etc/apache2/sites-available | |
20) Open : sudo nano 000-default.conf // Change path from var/www/html to var/www/html/wordpress | |
ENABLE SITES NOW: | |
_________________ | |
21) Enter path : cd etc/apache2/sites-enabled | |
22) a2ensite 000-default.conf // if its blue then its enabled but do it anyway | |
23) Reload apache: sudo service apache2 restart | |
// your wordpress should be up and running | |
<------------------------------------------------------------------------> | |
IMP stuff just for Me , you may leave | |
Wordpress overide permision: | |
_____________________________ | |
sudo chown -R www-data:myusername /var/www/html | |
sudo find /path/to/your/wordpress/install/ -type d -exec chmod 775 {} \; | |
sudo find /path/to/your/wordpress/install/ -type f -exec chmod 664 {} \; | |
Download astra and elemonter and livemesh | |
_________________________________________ | |
First Sudo apt-get install php-xml //download php xml | |
Then Install CURL by typing sudo apt-get install curl // download curl | |
Then Restart Apache by typing sudo service apache2 restart | |
Then Install PHP5 CURL by typing sudo apt-get install php-curl // download php curl | |
Then Restart Apache by typing sudo service apache2 restart Done! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment