Jump to content
wilsea

can't get past home page after reinstalling wamp

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?  

Share this post


Link to post
Share on other sites

Just discovered The Uniform Server through a post from SiNNut, and now I'm up and going with it. Completely painless.

I'm curious to know if there was a simple fix for wamp, and also what servers people are using though.

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
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 :)

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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. 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By modifiedcontent
      Has anyone successfully installed Processwire on an Amazon EC2 instance/virtual server?
      Which configuration works; Amazon Linux or one of the other flavors?
      How do you get file permissions and the database working?
      Which lines in .htaccess cause problems on Amazon AWS? 
      What are the pitfalls to watch out for?
      Why can't I get it working...?
      The first problem I run into is an error message that the installer doesn't have write access and that I should manually rename the 'site-myprofile' folder to 'site'. Attempt to chmod all the files and folders to 777 don't seem to have any effect on that and some files do get written fine.
      But I keep ending up with inaccessable pages and fatal server errors. I am not asking you to solve my problem. I am curious what other people's experiences are with this. Can it be done or am I wasting my time?
       
    • By hellomoto
      I have web hosting with the following .htaccess en root, to point it to a subdirectory "audino.us", wherein I have PW installed:
      RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?something.com$ RewriteCond %{REQUEST_URI} !^/something.com/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /audino.us/$1 RewriteCond %{HTTP_HOST} ^(www.)?something.com$ RewriteRule ^(/)?$ something.com/index.php [L] RewriteCond %{HTTP_HOST} ^(www.)?something.com$ RewriteRule ^(/)?$ something.com [L] However when I go to audino.us/pw to access the admin, it becomes audino.us/audino.us/pw, and doesn't allow me to log in. How do I render the above to be recursive (?), i.e., to apply to all subordinate URLs? Is this to be done within the .htaccess in /audino.us, or in the root .htaccess above? Please help, I can't log in. Thanks much.
    • By sudodo
      777 seems excessive - is there something that I'm missing here?
      This is a print out of the /site content;
      ```
      total 28
      drwxrwxr-x 6 geot geot 4096 Sep  9 13:30 .
      drwxrwxr-x 8 geot geot 4096 Sep  9 13:17 ..
      drwxrwxr-x 2 geot geot 4096 Sep  6 10:10 assets
      -rwxrwxrwx 1 geot geot 1548 Sep  6 10:10 config.php
      drwxrwxr-x 3 geot geot 4096 Sep  6 10:10 install
      drwxrwxr-x 2 geot geot 4096 Sep  6 10:10 modules
      drwxrwxr-x 5 geot geot 4096 Sep  6 10:10 templates
      ```
      I'm sure that I shouldn't have to have permissions so high, but I'm pretty new
      to this.

      Here's a shot of the setup that I'm currently going through;

      http://imgur.com/a/WkhAX

      You can see that the error (for site/config.php) is no longer there with these
      permissions, but they still 'feel' wrong.
      Thanks
       
    • By totoff
      Hi Forum,
      we moved an installation from the live server to localhost for further development. Unfortunately now PW doesn't find files in the /templates/ directory anymore (e.g. css, js and so on). Functions testing for existing files abort with an error and the console throws 404 for the files in question.
      Two developers have checked (so far several times):
      site/config.php $config->httpHosts .htaccess file permissions on /templates/ and all subdirectories (set to 777 just to be on the safe side) our own php functions Our version is 3.0.22 devns.
      We are running out of ideas. Any help is appreciated. Thanks.
    • By jean-luc
      Docker (http://www.docker.com) is an open platform for building, shipping and running distributed applications.   Docker containers are a great way to package a complete application with its specific dependencies in a portable way so that it can easily be deployed on any compatible network or cloud infrastructure.   Recently I spent a few days making my ProcessWire site run in a Docker container, and - as I could not find any good tutorial for this - it sounded like a good idea to write one.    You will find on the web plenty of presentations and tutorials about Docker, so I won't start with the basic concepts, and this tuto assumes that you have a first understanding of Docker's fundamentals.   What we want to do here is to migrate an existing site to a set of docker containers.   Therefore, to start with, you should have: - docker installed on your computer; - the site directory of your ProcessWIre site - a backup of your site's MySQL database   Let's start.   Create a docker container for the site database   For several reasons (insulation, security, scalability), it is preferable to host the site database in a separate docker container.    1. Set-up a SQL database with MariaDb or MySQL $ docker run --name database -e MYSQL_ROOT_PASSWORD=rootdbpassword -d mariadb Here I choose to use the MariaDB official container in its latest version, but MySQLwould be just fine as well.   2. Run a PhpMyAdmin container and create the ProcessWire database      We first select an simple image with PhpMyAdmin on the Docker Hub: nazarpc/phpmyadmin and we create a docker container based on this image. This container will  access the port exposed by the database container via a private networking interface. We specify this with the `--link` option.   It can be run temporarily (and exited by ctrl-C): docker run --rm --link database:mysql -p 8881:80 nazarpc/phpmyadmin Or it can be run as a daemon in the background: docker run -d --name phpmyadmin --link database:mysql -p 8881:80 nazarpc/phpmyadmin From phpmyadmin (accessed from your browser at http://hostaddress:8881) you can now create your ProcessWire database, create a dedicated user for it, and import the database content from a previously saved SQL file.   Note: alternatively, you can do all database operations from the command line in the database docker container created during step 1, or use another mysql user interface container if you prefer…   3. Update the database parameters in your site configuration   In your site's `config.php` file, the sql server name shall be set to `mysql`: $config->dbHost = 'mysql'; Other `$config->dbXxx` settings shall match the database name, user and password of the just-created database.     Create a Docker Image for Apache, PHP and the Processwire site   1. Create an image-specific directory with the following contents and `cd` to it bash-3.2$ ls -l . config .: total 16 -rw-rw-rw-   1 jean-luc  staff  1163 21 aoû 12:09 Dockerfile drwxr-xr-x  17 jean-luc  staff   578 17 aoû 12:48 ProcessWire drwxr-xr-x   7 jean-luc  staff   238 21 aoû 12:07 config drwxr-xr-x   7 jean-luc  staff   238 20 aoû 18:46 site config: total 160 -rw-rw-rw-  1 jean-luc  staff    160 20 aoû 18:28 msmtprc -rw-rw-rw-  1 jean-luc  staff  72518 20 aoû 18:56 php.ini where: `ProcessWire` contains the version of ProcessWire that we want to use for this site;  
      It can be retrieved from github with a link like https://github.com/ryancramerdesign/ProcessWire/archive/{version}.zip`  
      For example, the 2.6.13 dev version can be obtained by the link https://github.com/ryancramerdesign/ProcessWire/archive/7d37db8d6b4ca6a132e50aff496a70e48fcd2284.zip `site`: our site-specific files `Dockerfile`: the dockerfile for building the image (see below) `config`: a directory containing specific configuration files copied to the docker image (see below) 2.  Set the `Dockerfile` content FROM php:5.6-apache RUN    apt-get update \ && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng12-dev zziplib-bin msmtp\ && a2enmod rewrite \ && a2enmod ssl \ && docker-php-ext-install mysqli pdo_mysql iconv mcrypt zip \ && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ && docker-php-ext-install gd  EXPOSE 80 EXPOSE 443 # Add a specific php.ini file COPY config/php.ini /usr/local/etc/php/ # Configure the mail sent utility msmtp (http://msmtp.sourceforge.net) and make it readable only by www-data COPY config/msmtprc /usr/local/etc/php/ RUN chmod 600 /usr/local/etc/php/msmtprc \ && chown www-data:www-data /usr/local/etc/php/msmtprc # Remove all default site files in /var/www/html RUN rm -fR /var/www/html/* # Copy ProcessWire core files COPY ProcessWire/wire /var/www/html/wire COPY ProcessWire/index.php /var/www/html/index.php COPY ProcessWire/htaccess.txt /var/www/html/.htaccess # Copy site-specific files COPY site /var/www/html/site # Make www-data the owner of site-specific files RUN chown -R www-data:www-data /var/www/html/site VOLUME /var/www/html/site Based on the official image `php:5.6-apache`, it installs missing packages to the system, adds  mod-rewrite and mod-ssl to Apache, plus a number of PHP modules needed by Processwire (core or modules): mysqli, pdo_mysql, iconv, mcrypt, zip, and gd.   Then it copies the site files to the location expected by the Apache server.  Finally it declares a Docker volume `/var/www/html/site` (i.e. the site files and assets), so that it can be shared with other containers.   3. Set the msmtp configuration   We need to configure a sendmail utility, so that we can send emails from php, for example when a user registers on the website. The simplest way to do it is to rely on an external smtp server to do the actual sending. That's why we use msmtp.   - define the desired smtp account in `config/msmtprc` account celedev-webmaster tls on tls_certcheck off auth on host smtp.celedev.com port 587 user webmaster@celedev.com from webmaster@celedev.com password thepasswordofwebmasteratceledevdotcom   - in `config/php.ini`, configure the sendmail command so it uses msmtp: sendmail_path = /usr/bin/msmtp -C /usr/local/etc/php/msmtprc --logfile /var/log/msmtp.log -a celedev-webmaster -t   4. Build the Docker image docker build -t php-5.6-pw-celedev . 5. Create a Data-only container for the site files docker run --name celedev-data php-5.6-pw-celedev echo "Celedev site data-only container" 6. Run the web server container docker run --name celedev-site -p 8088:80 --link database:mysql --volumes-from celedev-data -d php-5.6-pw-celedev Note that this container is linked to our database and shares the 'celedev-data' volume created previously   During development, it can be convenient to keep an access to the host file system from the container. For this, we can add a shared volume to the previous command: docker run --name celedev-site -p 8088:80 --link database:mysql -v /Users/jean-luc/web/test-docker:/hostdir --volumes-from celedev-data -d php-5.6-pw-celedev   Our ProcessWire website is now up and running and we can test it in our browser at http://hostaddress:8088. Great!   What we now have in Docker bash-3.2$ docker images REPOSITORY            TAG                 IMAGE ID            CREATED             VIRTUAL SIZE php-5.6-pw-celedev    latest              2aaeb241c2e2        3 hours ago         1.149 GB nazarpc/phpmyadmin    latest              e25cd4fd48b3        8 days ago          521 MB mariadb               latest              dd208bafcc33        2 weeks ago         302.2 MB debian                latest              9a61b6b1315e        5 weeks ago         125.2 MB bash-3.2$ docker ps -a CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                    PORTS                                         NAMES 68cc5d976f0d        php-5.6-pw-celedev    "apache2-foreground"     20 hours ago        Up 20 hours               443/tcp, 0.0.0.0:8088->80/tcp                 celedev-site 0729fe6d6752        php-5.6-pw-celedev    "echo 'Celedev site d"   20 hours ago        Exited (0) 20 hours ago                                                 celedev-data e3e9e3a4715c        mariadb               "/docker-entrypoint.s"   3 days ago          Up 3 days                 3306/tcp                                      database Saving the site data   We can create an archive of the site files by running a tar command in a dedicated container: bash-3.2$ docker run --rm -it --volumes-from celedev-data -v /Users/jean-luc/web/test-docker:/hostdir debian /bin/bash root@2973c5af3eaf:/# cd /var/www/html/ root@2973c5af3eaf:/var/www/html# tar cvf /hostdir/backup.tar site root@2973c5af3eaf:exit bash-3.2$ Tagging and archiving the Docker image   We can also add a tag to the docker image that we have created in step 4 (recommended): bash-3.2$ docker tag 2aaeb241c2e2 php-5.6-pw-celedev:0.11 bash-3.2$ docker images REPOSITORY            TAG                 IMAGE ID            CREATED             VIRTUAL SIZE php-5.6-pw-celedev    latest              2aaeb241c2e2        3 hours ago         1.149 GB php-5.6-pw-celedev    0.11                2aaeb241c2e2        3 hours ago         1.149 GB nazarpc/phpmyadmin    latest              e25cd4fd48b3        8 days ago          521 MB mariadb               latest              dd208bafcc33        2 weeks ago         302.2 MB And we can archive this image locally if we dont want to push it now to the Docker Hub: bash-3.2$ docker save php-5.6-pw-celedev:0.11 | gzip > php-5.6-pw-celedev-0.11.tar.gz  And that's it!
      You now have a portable image of your ProcessWire website that you can run directly on any docker-compatible system.
×
×
  • Create New...