diveguy84
Posts: 7
Joined: Mon May 30, 2016 8:29 pm

installing 2 different versions of wordpress

Mon May 30, 2016 10:38 pm

Here is my hardware setup.
I have a wireless router behind a cable modem.
I do not have any/limited experience setting up Apache or wordpress.

I installed the first version of wordpress using apt-get Using the instructions in my hardcopy of "Raspberry Pi Users Guide" , purchase at the same time as a Pi2. After going to wordpress,.org site and seeing how out of date the apt-get wordpress package, plus know how many problems there have been with wordpress i am trying to install a second version ow wordpress using the online document "lamp-web-server-with-wordpress" in the learning section from the raspberrypi.org.

Here is the history of what i have done so far.

under sudo I ran or did:

apt-get install apache2 php5 mysql-server And followed the install prompts
Used the descktop webviewer to 127.0.0.1 and got the apache2 "it works" page

Created a index.php script to create a limited "it works" under /var/www/html
opened 127.0.0.1/index.php and got my limited "it Works'" then removed index.php

apt-get install wordpress
ln -s /usr/share/wordpress /var/www/html/wordpress (i changed from /var/www
bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost
opened 127.0.0.1/wordpress set the values and wordpress filled in the database and then opened the wordpress main page.

So far so good At anytime I could open wordpress using 127.0.0.1/wordpress and then sign in and post and look at posts.
I ran ln -s config-127.0.0.1.php config-
I did not do any further customization.

Some days later is when I noticed the newer install method and newer version available at wordpress.org.
So:
I created a new directory /var/www/html/wordpress2 and then used the correct wget,mv and rm tar commands.
that left the various wp-*.php ... content under /var/www/html/wordpress2. unlike the /var/www/html/wordpress/ symlink back to /usr/share/wordpress.
I myysql -u root and then
mysql>create database wordpress2;
and cntrl-d to exit.

I open http://127.0.0.1/wordpress2 which leads to:
http://127.0.0.1/wp-admin/setup-config.php which leads to:
http://127.0.0.1/wordpress2/wp-admin/setup-config.php?step=1
I fill in the new database anem:wordpress2
a new userid
a new password
localhost as the hostname
and leave wp_ as the table prefix
when I click the submit button I get the following
http://rickwpi.info/wordpress2/wp-admin/setup-config.php?step=2
Error establishing a database connection.
Looking in /var/www/html/wordpress2 I see that the is a wp-conffig.sample.php
But no config.php file.
Also ther is nothing in /var/lib/mysql/wordpress2.

I am not sure who to proceed from here.

mthomason
Posts: 113
Joined: Sun Apr 24, 2016 12:28 pm

Re: installing 2 different versions of wordpress

Wed Jun 01, 2016 1:25 am

Apt likes to install packages for the system as a whole, in defined filesystem locations. So, you get config files in /etc, data in /var, and code in /usr. The normal Wordpress install, however, prefers to sit together as a combined whole, as it is designed for use in standard hosting environments (where the user typically only has access to their own user folder, and an apache virtual host in somewhere like /home/username/www)

For things like Wordpress, I prefer avoiding apt and going directly with the recommended manual install. Create a new linux user for your Wordpress site, set up a brand new Apache virtual host under that user's home directory, and then perform the manual Wordpress install from https://wordpress.org/download/ as that user - trust me, it'll go a lot smoother than worrying about spreading bits of Wordpress all over the linux filesystem - although you'll still need to be aware that your SQL database will be in the usual place and not under that user's home.

diveguy84
Posts: 7
Joined: Mon May 30, 2016 8:29 pm

Re: installing 2 different versions of wordpress

Wed Jun 01, 2016 12:46 pm

mthomason wrote: For things like Wordpress, I prefer avoiding apt and going directly with the recommended manual install. Create a new linux user for your Wordpress site, set up a brand new Apache virtual host under that user's home directory, and then perform the manual Wordpress install from https://wordpress.org/download/ as that user - trust me, it'll go a lot smoother than worrying about spreading bits of Wordpress all over the linux filesystem - although you'll still need to be aware that your SQL database will be in the usual place and not under that user's home.
SD cards are so cheap. SO I used 3 of my six :D to do some testing. 1st is a single Wordpress install using apt-get and no virtual hosts. 2nd is a single Wordpress install using the Wordpress method and no virtual hosts. The first 2 work fine. And the 3rd is as described in the original post also no virtual hosts.

I don't know how to setup an Apache virtual host or I would pursue that. Does it require alias entries in the /etc/hosts file? And if I register a host using cloadns.net and use their dynamic dns perl script to periodically make sure that the dns record points to my cable modem/router And then I set my router to 1) assign a static IP to my pi and pass port 80 and 443 requests to that IP would I have to register each alias as a host name to get access to that virtual host from the outside world.

I suspect that the 2nd Wordpress instance correctly detects that the wp-config.php is missing from the 2nd instance's directory and correctly enters the dialog to setup it up which prompts for the info to create the wp-config.php entry. But after completing the form it may be balking at the exsistance of the /etc/wordpress/config-127.0.0.1.php and an alias entry of config-localhost.php -> config-127.0.0.1.php in that directory as well. I further suspect that even if I could create a config-<alias-name>.php entry with all the correct info it would never be used because dns resolver services would alway resolve to 127.0.0.1 or the 192.168.9.xxx IPds and thus the original cinfig-127.0.0.1.php entry . On a second front I havent seen any exaples that would allow me to define both instances in the single coonfig-<name>.php.

Getting back to problem as reported by attemping to enter my Wordpress2 instance. The setup error page states:

Code: Select all

This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at 127.0.0.1. This could mean your host’s database server is down.
I don't see a wp-config.php in my wordpress2 directory and I am not sure where the prompt form stuffed the info it asked for that is supposed to go into a wp-config.php. My wp-config.php in my wordpress directory ils -l timestamp is unchanged. Did one get stuffed somewhere else and if so where?
I can enter mysql from command line.

So many questions for a follow post to an original post with lots of details as well. :D :D :D
I am learning a lot about Apache and Wordpress but it is coming slowly.

Return to “Advanced users”