• laurex

    (@laurex)


    I am trying to install two test sites using MAMP. I followed the instructions in several other WP.org forum answers, but I can’t find the particular issue I’m encountering. My first site, site-1, works as expected. However, when I opened my second site, site-2, for the installation, it said wordpress was already installed and then gave me the login screen. I logged in and now when I open the site-2 from localhost:8888 it shows the first test site, and if I click on anything there, it goes (in the nav bar) to /site-1.

    I have two databases in myPHPadmin, one for site-1 called wordpress, which currently is populated with WordPress files, and a second one called wordpress2 (also the name of the file in root that is in the site-2 folder) which is empty.

    Any help with this would be appreciated!

Viewing 7 replies - 1 through 7 (of 7 total)
  • You could install the 2md WordPress in a sub-directory, your two websites would then be:

    http://localhost:8888/
    http://localhost:8888/wp2

    And their logins:

    http://localhost:8888/wp-admin
    http://localhost:8888/wp2/wp-admin

    BUT I strongly advise that this is not the true way forward, what is far better is to configure your websites to use virtual server configurations.
    In you apache2 website configuration you add:

    <VirtualHost *:80>
    DocumentRoot C:/base directory to site 1
    ServerName site1.local
    ServerAlias www.site1.local
    </VirtualHost>
    
    <VirtualHost *:80>
    DocumentRoot C:/base directory to site 2
    ServerName site2.local
    ServerAlias www.site2.local
    </VirtualHost>

    And then aqdd these lines to your hosts file:

    127.0.0.1	site1.local
    127.0.0.1	www.site1.local
    127.0.0.1	site2.local
    127.0.0.1	www.site2.local

    Details on your hosts file here:
    http://en.wikipedia.org/wiki/Hosts_%28file%29

    Then you change your website address and site address to:

    http://site1.local
    OR
    http://site2.local

    Further more on other computers on yout LAN you can add lines like:
    192.168.1.7 site1.local
    Where the ip address is that of your web server.

    This way your websites behave much more like they will on the real net, and you avoid lots of localhost issues.

    Thread Starter laurex

    (@laurex)

    Hi Ross,

    I followed your instructions but when I go to site1.local, I get an error. “Firefox can’t establish a connection to the server at site1.local.”

    Could there be anything in my original setup that conflicts with what you said here?

    I have been trying to make this work for 2 weeks and I can’t believe it’s that hard, but perhaps I have done something based on a previous solution that is running up against this one.

    Thanks.

    So you have added the lines to your “hosts” file.
    You have edited your apache2 configuration “sites-enabled” file ? What settings are already in this file ?

    You then tried to browse in firefox to “http://site1.local/&#8221;
    Have you tried other browsers ? Chrome ? Safari ?

    Thread Starter laurex

    (@laurex)

    Here is what I put in hppd-vhosts.conf (hope that was right)

    <VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot “/users/Sites/curiouser”
    ServerName curiouser.local
    ServerAlias http://www.curiouser.local
    ErrorLog “logs/curiouser-error_log”
    CustomLog “logs/curiouser-access_log” common
    </VirtualHost>

    <VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot “users/Sites/synapsistic”
    ServerName synapsistic.local
    ErrorLog “logs/synapsistic-error_log”
    CustomLog “logs/synapsistic-access_log” common
    </VirtualHost>

    I added the lines to hosts.

    Other browsers don’t work.

    I am not sure about the quotes in the conf file, they are probably harmless. Just make sure that they are not typographic quotes.
    I also assume that the ServerAlias does not have a http:// prefix, that this is an artefact of this support website.

    I found this website on MAMP virtual host configuration:
    http://sawmac.com/mamp/virtual/
    It gives the configuration file as:
    Applications:MAMP:conf:apache:httpd.conf

    Suggest working through the configuration from the above website.
    Have you looked into the apache2 log files ?
    (I am using Linux / Ubuntu), though the apache2 server is the same there are some differences.)

    Thread Starter laurex

    (@laurex)

    Thanks for your ongoing help. I made sure the virtualhost was configured as in the website. I double checked all the quotes.

    It still is returning a file not found.

    I feel like I have modified too many things to start clean, but I’d just as well give up if I could get back to having at least one local site working.

    Here are the apache2 error log entries today:
    [Tue May 05 21:13:30 2015] [notice] Digest: generating secret for digest authentication …
    [Tue May 05 21:13:30 2015] [notice] Digest: done
    [Tue May 05 21:13:30 2015] [notice] FastCGI: process manager initialized (pid 33108)
    [Tue May 05 21:13:30 2015] [notice] Apache/2.2.29 (Unix) mod_wsgi/3.4 Python/2.7.8 PHP/5.6.7 mod_ssl/2.2.29 OpenSSL/0.9.8zd DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.8 Perl/v5.20.0 configured — resuming normal operations
    [Tue May 05 21:17:06 2015] [notice] caught SIGTERM, shutting down
    [Tue May 05 21:17:13 2015] [notice] Digest: generating secret for digest authentication …
    [Tue May 05 21:17:13 2015] [notice] Digest: done
    [Tue May 05 21:17:13 2015] [notice] FastCGI: process manager initialized (pid 33329)
    [Tue May 05 21:17:13 2015] [notice] Apache/2.2.29 (Unix) mod_wsgi/3.4 Python/2.7.8 PHP/5.6.7 mod_ssl/2.2.29 OpenSSL/0.9.8zd DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.8 Perl/v5.20.0 configured — resuming normal operations
    [Tue May 05 21:21:39 2015] [notice] caught SIGTERM, shutting down
    [Tue May 05 21:21:45 2015] [notice] Digest: generating secret for digest authentication …
    [Tue May 05 21:21:45 2015] [notice] Digest: done
    [Tue May 05 21:21:45 2015] [notice] FastCGI: process manager initialized (pid 33542)
    [Tue May 05 21:21:45 2015] [notice] Apache/2.2.29 (Unix) mod_wsgi/3.4 Python/2.7.8 PHP/5.6.7 mod_ssl/2.2.29 OpenSSL/0.9.8zd DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.8 Perl/v5.20.0 configured — resuming normal operations

    All I can suggest is to uninstall your MAMP, and reinstall. Also see if this suite suits you better:
    http://www.ampps.com/

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Installing second site in MAMP- the second site redirects to the first one’ is closed to new replies.