sudo apt install mysql-server
sudo apt install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml sudo service nginx restart
WordPress installation on Apache / nginx ubuntu Debian goes here
sudo nano /etc/apache2/sites-available/epfouanloginportal.co.in.conf
sudo chown pubclubindia:pubclubindia /etc/apache2/sites-available/epfouanloginportal.co.in.conf
if root permission not there
past this
<VirtualHost *:80>
ServerAdmin pubclubindia@gmail.com
ServerName eaadharcarddownload.co.in
ServerAlias www.eaadharcarddownload.co.in
DocumentRoot /home/user/eaadharcarddownload.co.in
<Directory /home/user/eaadharcarddownload.co.in/>
Options Indexes FollowSymLinks MultiViews
Options All
AllowOverride All
Require all granted
</Directory>
ErrorLog /home/user/eaadharcarddownload.co.in/error.log
</VirtualHost>
sudo ln -s /etc/apache2/sites-available/aeaadharcarddownload.co.in.conf /etc/apache2/sites-enabled/aeaadharcarddownload.co.in.conf
or you can navbigate to cd /etc/apache2/sites-available/
and run this command sudo ln -s /etc/apache2/sites-available/burnbelly.in.conf
sudo here root level access i am not root user but own apachge directory
apachectl configtest
check for syntax error before restart becuase apache not able to start again.
sudo service apache2 reload
cheeck your website on browser.
install wordpress via command line
step 1: Navigate to the directory where you want install or create new directory and naigate there
sudo mkdir /home/user/eaadharcarddownload.co.in
chmod to 755
sudo chown pubclubindia:pubclubindia /home/user/eaadharcarddownload.co.in
chmod -R 755 /home/user/eaadharcarddownload.co.in
cd /home/user/eaadharcarddownload.co.in
step 2: Download wordpress & Unzip
wget http://wordpress.org/latest.tar.gz
unzip tar
tar xfz latest.tar.gz
By deafult wordrepss extracts in wordpress folder. then you have to move uplevel folder
step 3: and delete the exiting wordpress foder.
mv wordpress/* ./
step 4: Delete folder and zip archive
rmdir ./wordpress/
rm -f latest.tar.gz
Creation database from command line
mysql -u username -p u=seranme p=passowrd
mysql -u root -p enter this command and enter sql passwoprd.
mysql -u root -pRajuginne23@#
Step 2 create database dbname;
create database adhar;
For mysql root no need to assign privileges.
grant usage on *.* to username@localhost identified by ‘password’;
grant all privileges on dbname.* to username@localhost;
use adhar;
you get message like databse changed
CTRL+C to exit mysql
Edit wp-config.php (we can add database details 3 ways command line, browser and filemanager client)
add db details.
change table prefix
sudo nano ./wp-config-sample.php
or sudo nano ./wp-config.php
by deaflut wp-config.php not present in new install
we have added chages to wp-config-sample.php
rename filename in linux
mv wp-config-sample.php wp-config.php
rename -v wp-config-sample.php wp-config.php
Delete a MySQL Database on Linux via Command Line
DROP DATABASE burnbelly;
i have not added vhost file in apache
link vhost conf file from sites-avilable to sites-enabled in apache directory
chown
sudo chown -R netjob.p.871:netjob.p.871 /var/www/
change apache.conf
apache htaccess allow rewrite
sudo nano /etc/apache2/sites-available/default
Once inside that file, find the following section, and change the line that says AllowOverride from None to All. The section should now look like this:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
sudo chown -R pubclubindia:pubclubindia /home/user/
rm -rf /home/user/wp-content/cache/object
<Directory /home/user/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
sudo chown -R jagdisshanandh:jagdisshanandh /var/www/*
nginx wp install
Part 1 DB creation part
1.mysql -u root -prootpass -e “create database dbname;”
user creation example below:
sudo mysql -e “CREATE USER ‘datadog’@’localhost’ IDENTIFIED BY ‘h3ub7BmyGv UL5TskBFlG9rF’;”
mysql -u root -prootpasss -e “CREATE USER ‘datadog’@’localhost’ IDENTIFIED BY ‘h3ub7BmyGv UL5TskBFlG9rF’;”
Part 2 wp & db details add
sudo mkdir /var/www/html/website.com && cd /var/www/html/website.com && wget https://wordpress.org/latest.tar.gz && tar xfz latest.tar.gz && mv wordpress/* ./ && rmdir ./wordpress/ && rm -f latest.tar.gz && mv wp-config-sample.php wp-config.php && sudo nano ./wp-config.php
b. Change database details c. save file and exit by (CTRLX+X and Then type and Press Enter)
tail /var/log/nginx/error.log
Part 3 Vhosts setup
cat >/etc/nginx/sites-enabled/website <<EOF
server {
listen 80;
root /var/www/html/website/;
server_name website.com www.website.com;
include /etc/nginx/conf.d/global.config;
}
EOF
nginx -t && nginx -s reload
//ln -s /etc/nginx/sites-available/website.com /etc/nginx/sites-enabled/website.com
chown www-data:www-data -R /var/www/html/
1.
Point domain IP to Server IP.
migration server apache to nginx
navigate to the directory
cd /home/pubclubindia/epf/theonlineking.com
zip -r zipfilename.zip folder name
zip -r king.zip theonlineking.com
backup sql
know the database name by wp-config.php
export
mysql -u root -psqlpass king > /home/pubclubindia/epf/theonlineking.com/a.sql
import command
mysql -u root -psqlpass king < /var/www/html/king.sql
mysql login
mysql -u root -p
mysql -u root -psqlpass
create database king;
Next vhost nnginx
grant permissions to server user
chown www-data:www-data -R /var/www/html/
Ask a Question: