Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 11th October 2012, 09:22
destinedjagold destinedjagold is offline
Junior Member
 
Join Date: Aug 2012
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
 
Default CentOS - Virtual Host Problem

Hello and good day everyone.

Okay, so here I am again, with my original problem. I will try and provide the much needed information, in hopes that anyone can help me.

I have set up a local LAN-only server with a CentOS PC.
Note: only for local LAN access only.

The server is fine and I can access it when I type the server's static I.P. address.
Now, I wanted to simply type mywebsite.com to access the server, so, since I am using Windows 7 OS PC, I edited my host file located in C:/windows/system32/drivers/etc/hosts .
Code:
	192.168.1.16 	mywebsite.com 	# CentOS Server
And with that, I can finally simply type mywebsite.com and I can access the CentOS server.

And now, onto the problem...
I have a php file that I needed to be displayed, which is located in var/www/html/location1/location2/location3/location4
Simply typing mywebsite.com/location1/location2/location3/location4 works, but I want the server to directly display the php file located in that location by simply me typing mywebsite.com

I want to directly access a specific php file to be displayed when I type mywebsite.com...
I have written a .conf file for the server located in the /etc/httpd/conf.d with these codes...
Code:
<VirtualHost *:80>
  ServerName  www.mywebsite.com
  ServerAlias mywebsite.com


  DocumentRoot /var/www/html/location1/location2/location3/location4

    Redirect 404 /favicon.ico
    <Location /favicon.ico>
        ErrorDocument 404 "No favicon"
    </Location>

  ErrorLog  /etc/httpd/conf/vhosts/log/location-error.log

</VirtualHost>
I restarted the service httpd, and afterwards, I typed mywebsite.com again, but it instead displays an error with the message
Code:
Not Found
The requested URL /location1/location2/location3/location4/login.php was not found on this server.
Apache/2.2.15 (CentOS) Server at mywebsite.com Port 80
The error log displays this...
Code:
[Thu Oct 11 11:00:26 2012] [error] [client 192.168.1.9] File does not exist: /var/www/html/location1/location2/location3/location4/location1/location2/location3/location4
I don't understand the error log. Why did it displayed location1/location2/location3/location4 twice?

Any help would greatly appreciated. Thank you.
Reply With Quote
Sponsored Links
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
postfix problems with smtp linkdeb Server Operation 13 15th March 2014 18:58
Courier Imap is not working HellMind General 5 12th April 2012 02:04
iRedAdmin0.1.4 Virtual Host problem, please help j.smith1981 HOWTO-Related Questions 1 4th May 2011 11:00
ISPConfig3 Mail Warn Errors reason8 General 3 25th November 2009 14:58
Postfix problem: lost connection after CONNECT from unknown fernando_torrez Server Operation 5 30th November 2007 15:17


All times are GMT +2. The time now is 14:36.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.