hawkesley Posted October 4, 2014 Report Share Posted October 4, 2014 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.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 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. Quote Link to comment Share on other sites More sharing options...
Ric Posted October 5, 2014 Report Share Posted October 5, 2014 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 bestRic Quote Link to comment Share on other sites More sharing options...
hawkesley Posted October 5, 2014 Author Report Share Posted October 5, 2014 Thanks Ric,I will do that. Quote Link to comment Share on other sites More sharing options...
hawkesley Posted October 5, 2014 Author Report Share Posted October 5, 2014 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. Quote Link to comment Share on other sites More sharing options...
hawkesley Posted October 5, 2014 Author Report Share Posted October 5, 2014 Hi,Disregard last post. I had apache running.thanks. Quote Link to comment Share on other sites More sharing options...
hawkesley Posted October 5, 2014 Author Report Share Posted October 5, 2014 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. Quote Link to comment Share on other sites More sharing options...
Ric Posted October 6, 2014 Report Share Posted October 6, 2014 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 bestRic Quote Link to comment Share on other sites More sharing options...
hawkesley Posted October 6, 2014 Author Report Share Posted October 6, 2014 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 Quote Link to comment Share on other sites More sharing options...
hawkesley Posted October 7, 2014 Author Report Share Posted October 7, 2014 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 # <URL:http://httpd.apache....cs/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> Any thoughts?Best AnswerQuoteMultiQuote Quote Link to comment Share on other sites More sharing options...
hawkesley Posted October 7, 2014 Author Report Share Posted October 7, 2014 HiCould 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. Quote Link to comment 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.