Jump to content

Recommended Posts

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 internet
The 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.8
I 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/php
Any help appreciated.

Link to comment
https://forums.phpfreaks.com/topic/291475-server-displays-index-of/
Share on other sites

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.

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 
# 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> 

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.

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?

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?

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

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.