Jump to content


Photo

Apache serves Index of/


  • Please log in to reply
9 replies to this topic

#1 hawkesley

hawkesley

    Junior Member

  • Member
  • Pip
  • 36 posts
  • Main OS: Windows Vista

Posted 04 October 2014 - 12:29 PM

I have set up two directories in www which reflect two domains I have.
The directories hold a simple hello world page ( one index HTML mad 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 the either site I get the Index of/
My DirectoryIndex in the main apache config allows index.php & index.html.
I also have that in the .htaccess.
Long explanation but is this a question of setting up virtual hosts or is there other things to check first?
Any help appreciated.

#2 Ric

Ric

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 1,535 posts
  • Gender:Male
  • Location:Cambridge,UK
  • Interests:Electronics
    Internet in general
    Open source projects
  • SourceForge IDmpgcan
  • Wiki ID: Ric
  • Main OS: Windows XP

Posted 05 October 2014 - 03:13 AM

I assume the two domains you have represent two separate websites.

These need to be configured using VHosts. The www folder then becomes redundant more specifically becomes the default site if either the two sites cannot be resolved.

 

Setting up and configuring Vhosts, takes just a few mouse clicks, for details refer to the following documentation section Create Apache Vhost additional information is found on this page Apache Vhosts

 

All the best

Ric



#3 hawkesley

hawkesley

    Junior Member

  • Member
  • Pip
  • 36 posts
  • Main OS: Windows Vista

Posted 05 October 2014 - 04:24 AM

Thanks Ric,

I will do that.



#4 hawkesley

hawkesley

    Junior Member

  • Member
  • Pip
  • 36 posts
  • Main OS: Windows Vista

Posted 05 October 2014 - 04:48 AM

Hi Ric,

Went to set up Vhost but that option is not executable on the menu. If fact none of the first block is available also.

I checked that include extra is unchecked  so is there something to turn the Vhosts option on?

Thanks.



#5 hawkesley

hawkesley

    Junior Member

  • Member
  • Pip
  • 36 posts
  • Main OS: Windows Vista

Posted 05 October 2014 - 05:01 AM

Hi,

Disregard last post. I had apache running.

thanks.



#6 hawkesley

hawkesley

    Junior Member

  • Member
  • Pip
  • 36 posts
  • Main OS: Windows Vista

Posted 05 October 2014 - 05:05 AM

Ok set up Vhosts all looks ok, but I now get a 403 forbidden.

This occurred with my previous attempts with Coral 6.8 so I obviously need to do something but what.

Any suggestions appreciated.



#7 Ric

Ric

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 1,535 posts
  • Gender:Male
  • Location:Cambridge,UK
  • Interests:Electronics
    Internet in general
    Open source projects
  • SourceForge IDmpgcan
  • Wiki ID: Ric
  • Main OS: Windows XP

Posted 06 October 2014 - 04:38 AM

You now get a 403 forbidden error however did not state if this is for local or external (Internet) access. I am assuming its for Internet access, edit each .htaccess file in each Vhost root folder as follows:

 

Comment out the lines as shown:

 

#Order Deny,Allow

#Deny from all

#Allow from 127.0.0.1

#Allow from ::1

 

This allows access from the Internet.

 

All the best

Ric



#8 hawkesley

hawkesley

    Junior Member

  • Member
  • Pip
  • 36 posts
  • Main OS: Windows Vista

Posted 06 October 2014 - 05:34 AM

Hi Ric,

Yes external access.

Commented out Vhosts fine, but now get index of/ for each site.

apache config has Directory Index for index.html and index.php which are the two test pages which just say Hell World. Thes show on localhost Ok.

I put DirectoryIndex index.html index.php into the .htaccess files but still get index of/

Any suggestions?

Thanks



#9 hawkesley

hawkesley

    Junior Member

  • Member
  • Pip
  • 36 posts
  • Main OS: Windows Vista

Posted 07 October 2014 - 06:41 AM

I have established that I am not getting an index of each web folder but of the Vhost folder for the website.

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 and similarly for the second site.

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> 
 
Any thoughts?


#10 hawkesley

hawkesley

    Junior Member

  • Member
  • Pip
  • 36 posts
  • Main OS: Windows Vista

Posted 07 October 2014 - 10:43 AM

Hi

Could this be an issue with these two variables ${US_ROOTF} and ${HOME}

Where are these set so I can check them please.

Also ServerName${US_SERVERNAME}

I have not set a Server Name as it is my home server.The Ip is dynamic but managed by NO-IP which seems to work fine.

If anybody can help em with this please respond as I have to get this site working for a forthcoming birthday.

Many thanks.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users