Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
However when i access to "web1.abc.com", just default Apache appear although my index.php have in web1 folder.
Or, when i try to access "web1.abc.com/index.php", i have got the error message:
Quote:
Not Found
The requested URL /index.php was not found on this server.
Apache/2.0.52 (Red Hat) Server at qa.abc.com Port 80
Note: Squid listen on port 8008
Apache listen on 80
Note that DNS has to be proper for this to work (the virtual hostname has to be resolvable to the IP that apache's listening on)
Vhosts are processed in the order in which they appear in apache's configuration as well so browsing to the IP, will return the the first listed vhost in the config file(s)
Thanks for your help, i will edit port listen with 80 for every IP. It can work well, moreover i also add to DNS record. However, i also have another questions:
- Everything will configure exactly, but my Vhost doesn't effect. I have to restart Apache more times and wait long time to Vhost can work as i want. Why having the matter? Please tell me.
- When i type "web1.abc.com", it's ok. However if i type "abc.com/web1" or "www.abc.com/web1" Apache list all of the file in folder web1 . It's rather dangerous. How can i restrict this function? and why is it appear?
Please help me solve the problem. And again, thank you very much.
Everything will configure exactly, but my Vhost doesn't effect. I have to restart Apache more times and wait long time to Vhost can work as i want. Why having the matter? Please tell me.
I apologize and understand that english isn't your first language, but I'm having difficulty understanding this. Are you trying to say apache is taking a long time to restart? Do the vhosts work at all right now? (you seem to indicate that they do indeed work, just not as expected for some reason)
Quote:
When i type "web1.abc.com", it's ok. However if i type "abc.com/web1" or "www.abc.com/web1" Apache list all of the file in folder web1 . It's rather dangerous. How can i restrict this function? and why is it appear?
You may want to consider moving your vhosts outside of apache's main documentroot. Or changing the documentroot directive in httpd.conf to point elsewhere (ie /var/www/old_html).
Additionally, find the line in your default httpd.conf that looks similar to "Options Indexes FollowSymLinks" which follows directly after "<Directory "/var/www/html">" and comment it out, this will prevent apache from from listing your directory files.
I apologize and understand that english isn't your first language, but I'm having difficulty understanding this. Are you trying to say apache is taking a long time to restart? Do the vhosts work at all right now? (you seem to indicate that they do indeed work, just not as expected for some reason)
At this time, i really meet some problem with my Vhost:
- Some images does't load, i'm sure that they exist in my "images" folder.
- When i try to surf some link, i got the error "The page/ file not found on server...."
[QUOTE]You may want to consider moving your vhosts outside of apache's main documentroot. Or changing the documentroot directive in httpd.conf to point elsewhere (ie /var/www/old_html).
I want when client access "http://web1.abc.com/", they can access, but if they access to "http://www.abc.com/web1" ---or-- "http://abc.com/web1" will be denied or redirect to "http://web1.abc.com/"
Quote:
Additionally, find the line in your default httpd.conf that looks similar to "Options Indexes FollowSymLinks" which follows directly after "<Directory "/var/www/html">" and comment it out, this will prevent apache from from listing your directory files.
Yeah, i can do it. Thanks
Please help me solve the problem. Thank you very much
At this time, i really meet some problem with my Vhost:
- Some images does't load, i'm sure that they exist in my "images" folder.
- When i try to surf some link, i got the error "The page/ file not found on server...."
You'll need to check your apache error logs and figure out why the files you're requesting aren't loading, it could be a permission problem with the directory/files, but it's a hard guess without more information...
Quote:
I want when client access "http://web1.abc.com/", they can access, but if they access to "http://www.abc.com/web1" ---or-- "http://abc.com/web1" will be denied or redirect to "http://web1.abc.com/"
We Can do this with mod_rewrite eventually, but I'd suggest for now working on your existing problems so as not to complicate things further
Quote:
Sorry for my English
Please don't apologize, I doubt I'd be able to speak your native language at all, so you're already doing better than I
I think that "/web1/web1" can be the problem (wrong link)
Quote:
it could be a permission problem with the directory/files, but it's a hard guess without more information...
However when i use the address "http://www.abc.com/web1" --or-- "http://abc.com/web1", nothing error occurs.
Please help me solve the problem. Thank you very much.
Could you possibly have a coding issue with your site which is trying to load images (or whatever's failing) from http://web1.abc.com/web1/ ?
When you browse to "http://web1.abc.com" You're serving files from /var/www/html/web1, so an additional "/web1" in your code would be incorrect
(I dunno if that makes any sense to you .....ever have one of those times when you know WHAT you're trying to say but are unable to say what you mean? .....I'm having one right now )
Could you possibly have a coding issue with your site which is trying to load images (or whatever's failing) from http://web1.abc.com/web1/ ?
What does it mean? Sorry, i really don't understand . when i access some link of my wesite (written by PHP code), some picture can't be load, and some page can't appear EX: "http://web1.abc.com/report.php?command=show&id=97445"
Quote:
When you browse to "http://web1.abc.com" You're serving files from /var/www/html/web1, so an additional "/web1" in your code would be incorrect
How can i fix the problems. Please help me. Thanks so much, zeos
In the code that you've created for your site, do you have links which point to either http://www.abc.com/web1 OR to http://web1.abc.com/web1 ? (Could also be a global variable in the website code that you've previously configured to look for documents in that directory)
If so, you need to change the site coding and point it to the proper URL which is http://web1.abc.com .
What everything comes down to, is (as it appears from the logs) your site is requesting data from http://web1.abc.com/web1 which is an invalid location you need to figure out what in your code is trying to access data from that location and correct it to point to the PROPER location.
In the code that you've created for your site, do you have links which point to either http://www.abc.com/web1 OR to http://web1.abc.com/web1 ? (Could also be a global variable in the website code that you've previously configured to look for documents in that directory)
If so, you need to change the site coding and point it to the proper URL which is http://web1.abc.com .
So, i have to add some code into my default page (in case, index.php)?
Quote:
What everything comes down to, is (as it appears from the logs) your site is requesting data from http://web1.abc.com/web1 which is an invalid location you need to figure out what in your code is trying to access data from that location and correct it to point to the PROPER location.
Can you show me specific about this.
Thank you very much.
Can you show me specific about this.
Thank you very much.
I'm sorry, but there's no way I can know what the coding of your website is calling for. Did you design your pages yourself or are you using something that you've downloaded for your site?
It does however look as if we've moved out of the realm of networking/apache configuration and into the programming/coding world ...something which I'm generally not good at.
I make our (at my sites) servers go, we have other people who write interesting things to run on them I'm definatly NOT a programmer lol. I'll do my best to answer your questions, but hopefully someone who's familiar with whatever application you're trying to run on that site will chime in (once we know what it is)
I'm really thanks to zeos for your help.
I also isn't coder . So we can't do it if they relate to code.
However i would like to have petty question.
- Is my Virtual Host configuration right?
- Do you need to put or remove any parameters for my configuration?
Please help me, thank you very much. Actually, i want "the more simple , the better i get"
Thanks again.
It looks to be correct as it stands from what I can tell from here....Just to check, create a file in /var/www/html/web1 called "test.html" with some writing in it (the content doesn't really matter, we're just going to make sure we can load it ) Change the permissions on the "test.html" to 0777 (chmod 777 test.html) and attempt to goto http://web1.abc.com/test.html and see if it loads.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.