Jump to content

can't get past home page after reinstalling wamp


wilsea
 Share

Recommended Posts

I've reinstalled wamp,upgrading from 2.2 to 2.5 in the process,  and now I can't get past the home page on any processwire site on localhost - including the basic skyscraper site. That includes getting to the admin site with localhost:81/myprocesswire/processwire. Any page other than the home page returns me to the wampserver home page, with the url of the desired page in the address bar of the browser ie  http://localhost:81/process_skyscraper/cities/ displays the wamp home page. Apache is working fine for other sites (eg joomla). The difference seems to be the trailing slash at the end of the url.

Some googling came up with  WAMPServer 2.5 The Homepage, Your Projects Menu and the need for Virtual Hosts  and I followed the advice on that site to setup a virtual host for a processwire site.  It also seems to me to be a relatively complex process - (1) editing httpd-hosts.conf  (2) running notepad as administrator to edit C:\windows\system32\drivers\etc\hosts (3) running command prompt as administrator to restart dnscache . It doesn't seem to have made any difference. I tried DocumentRoot with and without the trailing slash in the VirtualHost settings.

My virtual host definition looks like this. 

<VirtualHost *:81>
     DocumentRoot "c:/wamp/www/process_skyscraper/"
     ServerName localhost
     ServerAlias localhost
     <Directory  "c:/wamp/www/process_skyscraper">
        AllowOverride All
 		Require local
     </Directory>
 </VirtualHost>

My gut feeling is that probably none of this is necessary, and I'm looking in the wrong place of a solution. Are all new users of processwire really going through these steps just to get it going?

Any thoughts on what I'm missing?  

Link to comment
Share on other sites

I do think setting up virtual hosts (in most cases) is a good practice and there really isn't that much to it. However, it seems you have your VirtualHost setup wrong. Localhost will already be defined by wampserver and probably has precedence over your vhost entry, hence localhost shows the wampserver startpage. I'll show and example of a working VirtualHost entry:

<VirtualHost *:${AP_PORT}>
 ServerAdmin webmaster@mysite.dev
 DocumentRoot ${US_ROOTF}/vhosts/mysite
 ServerName mysite.dev
 ServerAlias www.mysite.dev *.mysite.dev
 ErrorLog logs/mysite.dev-error.log
 CustomLog logs/mysite.dev-access.log common
 <Directory "${HOME}\vhosts\mysite">
   Options Indexes Includes 
   AllowOverride All   
   Require all granted 
 </Directory> 
</VirtualHost> 

In this case my PW files are in a /vhosts/mysite folder, but this can also be a full path like you did, as long as Apache can reach it. No need for a trailing slash in the document root. For vhosts to work you should also edit your Windows hosts file to match the vhost, in this case example adding a line "127.0.0.1 mysite.dev" to it. I can, and need, then approach this project via typing mysite.dev/ (or www.mysite.dev/) in a browser.

So i think you have to change servername and serveralias to something that makes sense to you; for example sitedomainname.dev, or anything you fancy. You will also have to add a line to the windows hosts file, like described above. Restart everything and it should work.

- dagnabbit, just when i was typing this you read my other post ;)

  • Like 2
Link to comment
Share on other sites

Thanks SiNNut.

I've tried this

<VirtualHost *:81>
     DocumentRoot "c:/wamp/www/process_skyscraper"
     ServerName skyscraper.dev
     ServerAlias www.skyscraper.dev *.skyscraper.dev
     <Directory  "c:/wamp/www/process_skyscraper">
        AllowOverride All
 		Require local
     </Directory>
 </VirtualHost>

and in etc/hosts

127.0.0.1       skyscraper.dev
::1 skyscraper.dev

along with stopping and restarting dnscache, and restarting wamp server.  Localhost still works, but can't find skyscraper.dev.  Typing skyscraper.dev into the browser kicks off a google search (Chrome) or  a 404 in Firefox.

Looks like I'm still missing something. I notice the slashes for the directory are in the other direction in your example - am I correct in thinking that is related to the OS of the server?

Link to comment
Share on other sites

You'll need to use: http://skyscraper.dev the first time to try to go to the address. After that your browser will realize you're not trying to search for it and you'll be able to just enter: skyscraper.dev

Bring back the search box if you ask me :)

Link to comment
Share on other sites

You'll need to use: http://skyscraper.dev the first time to try to go to the address. After that your browser will realize you're not trying to search for it and you'll be able to just enter: skyscraper.dev

Bring back the search box if you ask me :)

Or simply type skyscraper.dev/ in your browser address bar. Notice the slash; this will also make the browser aware of what you are trying to do the first time.

Also, did you not manage to get things going with UniServer? Using the controller program that comes with it to create a vhost and edit the hosts file might be less confusing and less error prone for you. When going that route be aware that by default this will create a vhosts directory inside the UniServerZ directory where it expects you to place you project files (i.e. document root).

  • Like 1
Link to comment
Share on other sites

if this all doesn't work, one can get an info output of vhosts (with apache on windows) with calling: cmd /K C:\Apache2\bin\httpd.exe -S

(replace C:\Apache2 with the path to your apache directory)

This gives a screen like

post-1041-0-87694800-1402334011_thumb.jp

Link to comment
Share on other sites

This forum rocks!

I've activated the rewrite_module suggested by 3fingers (I didn't know you could link directly to dropbox accounts - neat) and now the site via wamp server works as it used to with the earlier version of wamp - navigating from page to page is fine using localhost:81/ skyscraper as the root in the browser . :rolleyes:

As far as I'm concerned, I have two solutions for my initial problem - activate the rewrite_module for apache with wamp, or go with the more user friendly uniform server. (Note sure that I'll be able to hit the solved button twice though).

A big thankyou to everyone for your help.   I'm learning heaps through this forum. 

At this stage apache is still a big mystery to me - I  still haven't got the hang of virtual hosts, on either wamp or UniServer (a joy to use). Since on my machine both wamp and UniServer access data from  an independent installation of MySQL (computer a handmedown from another user and in earlier days I couldn't figure out how to turn the automatically starting MySQL server off), I can switch between servers quite easily.

So far I've been unable to convince the browser that skyscraper.dev/ ,  http://www.skyscraper.dev exists , with either wamp or uniform versions of apache.

The  output of vhosts for (wamp) apache looks OK to me   - port:81 namevhost skyscraper.dev  alias www.skyscraper.dev   wildalias *.skyscraper.dev, 

-  "Include conf/extra/httpd-vhosts.conf"    on the http.conf file is uncommented.

- name is correctly spelt on etc/hosts file

- stopped and restarted the net dnscache through a cmd prompt

- for UniServer - copied the appropriate project files to the vHost directed created by uniserver

- checked for typos and made sure that server was actually running and online.

It's not an important issue for me at present, but anyone can see what I'm missing something obvious I'd appreciate it.

  • Like 1
Link to comment
Share on other sites

The Apache rewrite module is a requirement for PW, regardless of which setup or wamp package you use. There is a check for this in the PW installation routine, so it should have given you a warning when installing PW. In wampserver you have to enable rewrite and in uniform it's enabled by default.

Regarding the vhosts: it's hard to tell why it won't work but i'm thinking it might be that the changes to the windows hosts file are being ignored. This seems to be a pretty common problem. Maybe you can try the stuff listed here:

http://serverfault.com/questions/452268/hosts-file-ignored-how-to-troubleshoot

And here:

http://answers.microsoft.com/en-us/windows/forum/windows_7-networking/hosts-file-ignored-windows-7-64-bit-firefox/dcad50c8-4242-435b-a87b-26ecd2ff7d97

Link to comment
Share on other sites

Thanks SiNNut - looks like some nice info and checklists in those links.

The warning for the rewrite module not being on probably didn't happen because processwire was already setup - I just copied the directories into the newly created  www directory, so didn't go through the install checks. 

Link to comment
Share on other sites

The warning for the rewrite module not being on probably didn't happen because processwire was already setup - I just copied the directories into the newly created  www directory, so didn't go through the install checks. 

This is something that should be included into the DiagnosticsModule, a check like it is done with the installation routine!

  • Like 1
Link to comment
Share on other sites

  • 5 months later...

Wilsea, 

Having the same problem here.  Do you find a solution for virtual hosts?  

Here is my httpd-vhosts.conf file:

<VirtualHost *:80>
    ServerAdmin admin@localhost
DocumentRoot "C:/mysite1"
    ServerName localhost
    ServerAlias www.localhost.com
    ErrorLog "logs/localhost-error.log"
    CustomLog "logs/localhost-access.log" common
</VirtualHost>
 
 
<VirtualHost *:80>
    DocumentRoot "C:/mysite2"
    ServerName rpw
ServerAlias rpw
    <Directory "C:/mysite2">
        Options Indexes FollowSymLinks MultiViews 
        AllowOverride None
        Order allow,deny
        Allow from all
Require all granted
    </Directory>
</VirtualHost>
 
Any ideas is really appreciated. 
 
March
Link to comment
Share on other sites

Ladies, Gentleman,

GOT IT!  Here it is:

AllowOverride All

or the second part of the httpd-vhosts.conf file here:

<VirtualHost *:80>
    DocumentRoot "C:/mysite2"
    ServerName propertymarch
ServerAlias propertymarch
    <Directory "C:/mysite2">
Options Indexes FollowSymLinks MultiViews 
    AllowOverride All
    Order allow,deny
    Allow from all
Require all granted
 
    </Directory>
</VirtualHost>
 
These PW forums are great.  It is good to be part of this nice community.  I hope this helps someone else.  
 
March 
  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...