How to install second local wordpress site on LAMP?

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
SamLearnsLinux
Level 3
Level 3
Posts: 108
Joined: Wed Jun 27, 2018 6:13 am

How to install second local wordpress site on LAMP?

Post by SamLearnsLinux » Tue Jul 10, 2018 9:59 am

Hi. I installed LAMP stack and my first site on wordpress using this video and these instructions shown inside it.
Step 1: Update the System
#apt-get update

Step 2: Install LAMP Server
#apt-get install lamp-server^

Step 3: Wordpress Database Initialization
#mysql -u root -p

Commands
CREATE DATABASE wordpressdb;
CREATE USER wordpressuser@localhost IDENTIFIED BY 'wordpresspassword';
GRANT ALL PRIVILEGES ON wordpressdb.* TO wordpressuser@localhost;
FLUSH PRIVILEGES;
exit

Step 4: Installing Wordpress
#cd /tmp
#wget http://wordpress.org/latest.zip
#unzip -q latest.zip -d /var/www/html/
#chown -R www-data:www-data /var/www/html/wordpress
#chmod -R 755 /var/www/html/wordpress
#mkdir -p /var/www/html/wordpress/wp-content/uploads
#chown -R www-data:www-data /var/www/html/wordpress/wp-content/uploads

Open web browser
http://ipaddress/wordpress

I now want to install a second site on localhost wordpress. I started directly from step 3. Create new database and admin. But now I'm stuck at step 4 and would like to know how I should proceed because wordpress has already been installed once before. Thank you

timbow
Level 1
Level 1
Posts: 43
Joined: Wed Oct 11, 2017 6:06 pm

Re: How to install second local wordpress site on LAMP?

Post by timbow » Tue Jul 10, 2018 11:54 am

A little confusion I think because the wordpress download once unzipped is all in a containing folder named 'wordpress'. Normally to make a new wp site once you have created the new database you would create a folder/directory in your localhost root, so in your case you would make the folder
/var/www/html/newsite
Then put all the contents of the wp download but not the containing folder into /newsite and do the wp install through the browser at
localhost/newsite/wp-admin/install.php

The method you describe puts the wp download including the containing folder into the localhost root giving you the site at
localhost/wordpress

The orthodox wordpress install is described here:
https://codex.wordpress.org/Installing_ ... stallation
I can't tell you anything about the chown and chmod stuff. Therein madness lies.

What video and instructions were you using?

User avatar
administrollaattori
Level 15
Level 15
Posts: 5877
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: How to install second local wordpress site on LAMP?

Post by administrollaattori » Tue Jul 10, 2018 1:47 pm

Install PhpMyAdmin, and use symbolic links and install the site into you $HOME directory.
viewtopic.php?f=47&t=265925&p=1445406&h ... n#p1445406

SamLearnsLinux
Level 3
Level 3
Posts: 108
Joined: Wed Jun 27, 2018 6:13 am

Re: How to install second local wordpress site on LAMP?

Post by SamLearnsLinux » Wed Jul 11, 2018 2:41 am

timbow wrote:
Tue Jul 10, 2018 11:54 am
A little confusion I think because the wordpress download once unzipped is all in a containing folder named 'wordpress'. Normally to make a new wp site once you have created the new database you would create a folder/directory in your localhost root, so in your case you would make the folder
/var/www/html/newsite
Then put all the contents of the wp download but not the containing folder into /newsite and do the wp install through the browser at
localhost/newsite/wp-admin/install.php

The method you describe puts the wp download including the containing folder into the localhost root giving you the site at
localhost/wordpress

The orthodox wordpress install is described here:
https://codex.wordpress.org/Installing_ ... stallation
I can't tell you anything about the chown and chmod stuff. Therein madness lies.

What video and instructions were you using?

Hello. I used https://www.youtube.com/watch?v=oLsA2kj_bMU and the instructions I quoted above are the ones shown in the video and also available in the description box of the video. Let me know if I should uninstall everything and set everything up again. I currently have no data on wordpress and nothing to lose

SamLearnsLinux
Level 3
Level 3
Posts: 108
Joined: Wed Jun 27, 2018 6:13 am

Re: How to install second local wordpress site on LAMP?

Post by SamLearnsLinux » Wed Jul 11, 2018 3:59 am

administrollaattori wrote:
Tue Jul 10, 2018 1:47 pm
Install PhpMyAdmin, and use symbolic links and install the site into you $HOME directory.
viewtopic.php?f=47&t=265925&p=1445406&h ... n#p1445406
If I set up phpmyadmin as suggested on the page you linked, all i have to do to install a new site locally is

Code: Select all

mkdir mysite1
sudo ln -s $HOME/mysite1 /var/www/html
and lets say a second site

Code: Select all

mkdir mysite2
sudo ln -s $HOME/mysite2 /var/www/html
?

User avatar
administrollaattori
Level 15
Level 15
Posts: 5877
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: How to install second local wordpress site on LAMP?

Post by administrollaattori » Wed Jul 11, 2018 2:56 pm

SamLearnsLinux wrote:
Wed Jul 11, 2018 3:59 am
administrollaattori wrote:
Tue Jul 10, 2018 1:47 pm
Install PhpMyAdmin, and use symbolic links and install the site into you $HOME directory.
viewtopic.php?f=47&t=265925&p=1445406&h ... n#p1445406
If I set up phpmyadmin as suggested on the page you linked, all i have to do to install a new site locally is

Code: Select all

mkdir mysite1
sudo ln -s $HOME/mysite1 /var/www/html
and lets say a second site

Code: Select all

mkdir mysite2
sudo ln -s $HOME/mysite2 /var/www/html
?
Correct. :wink:

SamLearnsLinux
Level 3
Level 3
Posts: 108
Joined: Wed Jun 27, 2018 6:13 am

Re: How to install second local wordpress site on LAMP?

Post by SamLearnsLinux » Thu Jul 12, 2018 12:19 am

administrollaattori wrote:
Wed Jul 11, 2018 2:56 pm

Correct. :wink:
Thank you. Once last thing, lets say I don't want my /home to be cluttered, can I create a folder and install all sites in it as

Code: Select all

sudo ln -s $HOME/localwordpress/mysite1 /var/www/html

SamLearnsLinux
Level 3
Level 3
Posts: 108
Joined: Wed Jun 27, 2018 6:13 am

Re: How to install second local wordpress site on LAMP?

Post by SamLearnsLinux » Thu Jul 12, 2018 5:44 am

SamLearnsLinux wrote:
Thu Jul 12, 2018 12:19 am
administrollaattori wrote:
Wed Jul 11, 2018 2:56 pm

Correct. :wink:
Thank you. Once last thing, lets say I don't want my /home to be cluttered, can I create a folder and install all sites in it as

Code: Select all

sudo ln -s $HOME/localwordpress/mysite1 /var/www/html
Also, after the above, I would still have to create a new database for each site on mysql, admin, password, grant permission etc right?

User avatar
administrollaattori
Level 15
Level 15
Posts: 5877
Joined: Tue Sep 03, 2013 4:51 am
Location: Finland
Contact:

Re: How to install second local wordpress site on LAMP?

Post by administrollaattori » Fri Jul 13, 2018 2:18 am

SamLearnsLinux wrote:
Thu Jul 12, 2018 12:19 am
Thank you. Once last thing, lets say I don't want my /home to be cluttered, can I create a folder and install all sites in it as

Also, after the above, I would still have to create a new database for each site on mysql, admin, password, grant permission etc right?
Yes.

Post Reply

Return to “Software & Applications”