Lassie Posted October 6, 2014 Share Posted October 6, 2014 I have set up two directories in www which reflect two domains I have using uniform server z which is a wamp package. I have set up Vhosts also. The sever is accessible from the internetThe directories hold a simple hello world page ( one index HTML and one index.php)I set these up on uniform server z to test access as I have previously had problems getting virtual host to work on coral 6.8I can test the IP address fine and ping the sever.I can access the two addresses from the net (not on my local network)How ever when I access either site externally I get the Index of/My DirectoryIndex in the main apache config allows index.php & index.html.I also have that in the .htaccess and in the Vhosts ht access.The Index of however only shows a favicon and not the index.html/phpAny help appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/291475-server-displays-index-of/ Share on other sites More sharing options...
requinix Posted October 6, 2014 Share Posted October 6, 2014 Do you get an index of www or of the two directories individually? Quote Link to comment https://forums.phpfreaks.com/topic/291475-server-displays-index-of/#findComment-1492891 Share on other sites More sharing options...
Lassie Posted October 7, 2014 Author Share Posted October 7, 2014 Hi, Index of/ does not show a title . It only shows the favicon of the uniform server, so I presume it is showing me the www directory. The contents of www are Folder hawkesleypublishingsolutions Folder somewhere4u Folder nbproject .htaccess .htaccess_back index.php favicon I would have thought it would show index.php I should add that this is my own home server I am using. index.php is again a simple hello world file which shows when staring up the server. Thank you for coming back. Quote Link to comment https://forums.phpfreaks.com/topic/291475-server-displays-index-of/#findComment-1492932 Share on other sites More sharing options...
Lassie Posted October 7, 2014 Author Share Posted October 7, 2014 As an experiment I changed the icon in the VHosts file and now that icon shows if I open the link in the index, which I guess means that the Directory being shown is the VHosts. The path is C:\Uniserver\vhosts\hawkesleypublishingsolutions This is the the http- vhost file # Virtual Hosts # # Required modules: mod_log_config # If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. Most configurations # use only name-based virtual hosts so the server doesn't need to worry about # IP addresses. This is indicated by the asterisks in the directives below. # # Please see the documentation at # <URL:http://httpd.apache.org/docs/2.4/vhosts/> # for further details before you try to setup virtual hosts. # # You may use the command line option '-S' to verify your virtual host # configuration. # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any <VirtualHost> block. # # First Virtual Host must be a shallow duplicate of the main host # in httpd.conf <VirtualHost _default_:${AP_PORT}> DocumentRoot ${US_ROOTF_WWW} ServerName ${US_SERVERNAME} ErrorLog "logs/error.log" CustomLog "logs/access.log" common </VirtualHost> <VirtualHost *:${AP_PORT}> ServerAdmin webmaster@hawkesleypublishingsolutions.com DocumentRoot ${US_ROOTF}/vhosts/hawkesleypublishingsolutions ServerName hawkesleypublishingsolutions.com ServerAlias www.hawkesleypublishingsolutions.com *.hawkesleypublishingsolutions.com ErrorLog logs/hawkesleypublishingsolutions.com-error.log CustomLog logs/hawkesleypublishingsolutions.com-access.log common <Directory "${HOME}\vhosts\hawkesleypublishingsolutions"> Options Indexes Includes AllowOverride All Require all granted </Directory> </VirtualHost> <VirtualHost *:${AP_PORT}> ServerAdmin webmaster@somewhere4u.com DocumentRoot ${US_ROOTF}/vhosts/somewhere4u ServerName somewhere4u.com ServerAlias www.somewhere4u.com *.somewhere4u.com ErrorLog logs/somewhere4u.com-error.log CustomLog logs/somewhere4u.com-access.log common <Directory "${HOME}\vhosts\somewhere4u"> Options Indexes Includes AllowOverride All Require all granted </Directory> </VirtualHost> Quote Link to comment https://forums.phpfreaks.com/topic/291475-server-displays-index-of/#findComment-1492934 Share on other sites More sharing options...
requinix Posted October 8, 2014 Share Posted October 8, 2014 I'm a little lost in your second reply but it looks like what I suspected: you have a third virtualhost which offers www/ (or whatever it actually is) as the default host. You should either 404 everything, or better redirect to another site. Then the indexing problem is moot. Quote Link to comment https://forums.phpfreaks.com/topic/291475-server-displays-index-of/#findComment-1492991 Share on other sites More sharing options...
Lassie Posted October 8, 2014 Author Share Posted October 8, 2014 Thanks. I am not sure I understand what you are saying. The first vhost is supposed to be the default, correct.As indicated in the apache config file. The vhosts are configured from the uniserver menu on the control panel so I don't understand what is wrong. The paths are set by variables e.g.${US_ROOTF} etc however I don't know how to check these values. Could you expand on your reply please? Quote Link to comment https://forums.phpfreaks.com/topic/291475-server-displays-index-of/#findComment-1493007 Share on other sites More sharing options...
requinix Posted October 8, 2014 Share Posted October 8, 2014 What URL are you using that gets the index page? Does it have the same domain name as one of those two hosts you have configured? Quote Link to comment https://forums.phpfreaks.com/topic/291475-server-displays-index-of/#findComment-1493063 Share on other sites More sharing options...
Lassie Posted October 9, 2014 Author Share Posted October 9, 2014 Yes.Thanks for your reply The url is used is www.xxxx.com and the folder is xxxx as per the ghosts above. If i try www.xxx.com/index.php I get a 404. Note the server is offline at present until I resolve this. Quote Link to comment https://forums.phpfreaks.com/topic/291475-server-displays-index-of/#findComment-1493121 Share on other sites More sharing options...
requinix Posted October 9, 2014 Share Posted October 9, 2014 How can you be testing it while it's offline? The problem is while you're accessing it externally... To be sure, because something's not adding up here, Apache's access log shows your (external) request and that it returns a 404? Quote Link to comment https://forums.phpfreaks.com/topic/291475-server-displays-index-of/#findComment-1493169 Share on other sites More sharing options...
Lassie Posted October 10, 2014 Author Share Posted October 10, 2014 By offline I mean I am not leaving it on permenately. of course it is on for testing. The access log gives ,where xxx is the website name, GET xxx/http1.1 404 227 Get xxx/index.php/http1.1/ 404 236 Get xxx/index.php/http1.1/ 404 236 GET favicon .ico http1.1 200 584 GET /http/1.1 200 358 Happy to provide anything else Thanks Quote Link to comment https://forums.phpfreaks.com/topic/291475-server-displays-index-of/#findComment-1493223 Share on other sites More sharing options...
requinix Posted October 10, 2014 Share Posted October 10, 2014 Well, see, I know you didn't copy/paste that from the access log because it's incorrect. So I said something's not adding up? Here it is: If i try www.xxx.com/index.php I get a 404. Get xxx/index.php/http1.1/ 404 236 Get xxx/index.php/http1.1/ 404 236 In the first post you said you went to /index.php but in the second post you're showing (if I read between the lines) access logs that correspond to a request for /xxx/index.php. You've posted your two domain names previously so there isn't really a reason you need to try to hide them anymore. As such, can you please post the exact access log lines that show the URLs you are visiting that return 404s? Quote Link to comment https://forums.phpfreaks.com/topic/291475-server-displays-index-of/#findComment-1493280 Share on other sites More sharing options...
Lassie Posted October 11, 2014 Author Share Posted October 11, 2014 The reason I entered them manually was that I was on a different machine at the time. I will repeat the exercise and post the logs. Thank you for your help. Quote Link to comment https://forums.phpfreaks.com/topic/291475-server-displays-index-of/#findComment-1493311 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.