Jump to content
The Uniform Server Community

index.html not loading


pathe3
 Share

Recommended Posts

Hi,

 

I'm a newbie to servers and plan to use Uniserver to test web site pages locally. I got it installed and followed the instructions here: http://wiki.uniformserver.com/index.php/Ne...k_Install_Guide. The default index.php page loaded up OK. When I replaced the files in www with my own web site pages (leaving htaccess); at first the index page loaded up OK using http://localhost/. After restarting my computer later, the index.html page doesn't load automatically; however, if I type in the full address http://localhost/index.html, everything works. If I replace my web site pages with the default index.php page, it comes up with http:/localhost/. I tried other index.html pages and they don't come up automatically. All I get is a directory page showing index of / with name, last modified, size, description columns. I searched through the forums but can't find a similar problem. What is going on?

Link to comment
Share on other sites

If I place the original files back in www, they override any html files placed in that directory. When I type http://localhost/, I get the php files. I'm sure it has to do with a configuration file somewhere. Is this normal behavior or did something go wrong?

 

I checked httpd.conf and index.html is listed. I tried reinstalling the server also but no change.

 

I downloaded the new version, 5.6.13 and it's working correctly. My index.html is overriding the index.php file. I'm not sure what was going on before. Seems OK now.

Link to comment
Share on other sites

It looks as if you have answerered your own question.

 

To recap; with the exception of file .htaccess delete everything in folder UniServer\www ideally create your own favicon.ico image file and place in this folder (prevents errors in log file and gives a browser something to display)

 

With the servers running typing http://localhost/ into a browser Apache will look for an index page to serve. It displays the first one it encounters from this list:

DirectoryIndex index.html index.shtml index.html.var index.htm index.php3 index.php index.pl index.cgi

 

If you do not have an index page a directory (folder) listing is displayed.

 

Background:

When you first start Uniform server it automatically displays the index.php page (contained in folder www). This is not normal server operation just a convenient way to confirm servers are running correctly with initial default files in folder www.

Note if not already running your default browser will automatically start.

 

Take a step back (assume servers not running) double clicking on index.html or index.php will result in index.html being displayed in your default browser and Windows asking for an application to open or run index.php What repose you get is dependent on file associations set-up on your PC. Default association are to open any file with extension .html in the default browser and no associations configured for extension php

 

What’s important you will see something like file:///C:/UniServer/www/index.html displayed in your browser navigation bar. Page is displayed directly from your hard drive and not served from the Apache server.

 

Start the servers and type http://localhost/index.html same page s displayed however Apache serves it to your browser. Similarly type http://localhost/index.php and that page is served.

 

A browser will open only .html (.htm) files automatically from disk however can be persuaded to effectively type into it’s navigation bar what we want and redirect to a page we wish served from Apache.

 

When Uniform Server is run the following page is opened in default browser:

file:///C:/UniServer/home/admin/www/redirect.html

 

Note: Depending where you extracted Uniform Server path may be different

Open file UniServer/home/admin/www/redirect.html in a text editor

 

Locate this line:

You can change index.php to any page you wish to display at start-up

 

If you want to disable this functionality

Edit file: UniServer\unicon\main\start_servers.php

Locate this line:

if ((int)$server_operation & 4 ){ // Enabled by config or parameter

Change to

if ((int)$server_operation & 400 ){ // Enabled by config or parameter

 

All the best

Ric :)

Link to comment
Share on other sites

Thanks for the detailed response.

 

Yes, I did try removing the original files except .htaccess and populating the www directory with mine - it didn't work. I had a full web site in the www directory including favicon and index.html. Maybe I hosed something when I first started playing around with it, but I deleted the server and reinstalled and it did the same thing. This was for the previous version 5.6.12. Version 5.6.13 didn't behave the same way with the same set of web pages. I did look through the forums, wiki and other documentation, but didn't find an answer to the problem. I did notice the apache error.log file did have a couple of entries in it that said something to the effect of "can't find index.php"; even though I had an index.html page in the www directory. So it was like it was looking specifically for index.php and nothing else. Like I said, maybe I did something wrong, but I didn't change any coding anywhere. Anyway it's working correctly now, but it was frustrating nevertheless.

 

I went through the entire directory structure and the configuration files for the server, so I learned something from it. I also noticed that redirect.html page, and that it only displays for a fraction of a second and goes away. I never thought about looking at the html code for that page. Good information about the redirect coding on it and for directions to disable the redirect functionality.

 

Anyway, glad it's working and there is a ton of online information that I will be going over to familiarize myself with this server.

 

Thanks again

Link to comment
Share on other sites

It might be a suprise to you that it is NOT necessary to populate your "full web site in the www directory" while you are running such a portable backend like Uniform Server. I would recommend a separate folder for web contents, and proper config your Uniform Server clones after every update, such that if something wrong it is easier to check them parallelly.

 

Thanks for the detailed response.

 

Yes, I did try removing the original files except .htaccess and populating the www directory with mine - it didn't work. I had a full web site in the www directory including favicon and index.html. Maybe I hosed something when I first started playing around with it, but I deleted the server and reinstalled and it did the same thing. This was for the previous version 5.6.12. Version 5.6.13 didn't behave the same way with the same set of web pages. I did look through the forums, wiki and other documentation, but didn't find an answer to the problem. I did notice the apache error.log file did have a couple of entries in it that said something to the effect of "can't find index.php"; even though I had an index.html page in the www directory. So it was like it was looking specifically for index.php and nothing else. Like I said, maybe I did something wrong, but I didn't change any coding anywhere. Anyway it's working correctly now, but it was frustrating nevertheless.

 

I went through the entire directory structure and the configuration files for the server, so I learned something from it. I also noticed that redirect.html page, and that it only displays for a fraction of a second and goes away. I never thought about looking at the html code for that page. Good information about the redirect coding on it and for directions to disable the redirect functionality.

 

Anyway, glad it's working and there is a ton of online information that I will be going over to familiarize myself with this server.

 

Thanks again

Link to comment
Share on other sites

Appreciate that, but I was already one step ahead. By reading the Uniform Server documentation, I setup 3 local virtual hosts on the server and placed different sites in each of them. I left the www root in its original configuration. I also installed another copy of the Server so that I can use it for troubleshooting in case of problems. I'm sure I'm not telling you anything you don't already know, but setting up the virtual hosts was a bit touchy; requiring starting and stopping the servers after each change when adding or deleting virtual hosts and testing them each time. Spent a lot of time trying different host names and such and setting up duplicates of online content on this server and getting them to work. Really interesting stuff that a server can be so small and portable. I am open to other suggestions for steps I should take next.

 

 

 

 

It might be a suprise to you that it is NOT necessary to populate your "full web site in the www directory" while you are running such a portable backend like Uniform Server. I would recommend a separate folder for web contents, and proper config your Uniform Server clones after every update, such that if something wrong it is easier to check them parallelly.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...