Solved

location of virtual domains/directories on apache web server( Red Hat 7.2)

Posted on 2004-10-14
14
257 Views
Last Modified: 2013-12-16
Hi Experts,
We have been providing web-hosting support to few of our clients and I was trying to locate the server name and document root  in Virtual Hosts section of httpd.conf file and couldn't find anything. However, the default path for all existing virtual domains is set to /usr/local/apache/htdocs. Is there any other location where the settings for Virtual Domains be stored ? Actually, I want to add  one client and delete the services for one existing account and  so, in a fix ...
0
Comment
Question by:mn210
  • 7
  • 6
14 Comments
 
LVL 6

Expert Comment

by:blkline
ID: 12310887
<VirtualHost 192.168.1.20:80>
        ServerAdmin root@localhost
        DocumentRoot "/var/www/doc"    <-------------    this line contains the document root
        ServerName doc.mydomain.net     <-------------    this line contains the server name
        ServerAlias doc                                 <-------------    this line is basically an "a.k.a"
        ErrorLog logs/doc.mydomain-error_log
        CustomLog logs/doc.mydomain-access_log common
        <Files "*.docmgr">
                Order allow,deny
                Deny from all
        </Files>
</VirtualHost>
0
 
LVL 7

Expert Comment

by:troopern
ID: 12328261
Is your V-Hosts in your httpd.conf or in a vhosts.conf file ?
0
 

Author Comment

by:mn210
ID: 12339759
I have checked the contents of  httpd.conf file and there is no entry for V-Hosts . Moreover, I have  checked the /etc/httpd/conf directory and all /etc directory and couldn't find vhosts.conf file.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 6

Expert Comment

by:blkline
ID: 12340711
I think he meant VirtualHost.

Do you have anything in /etc/httpd/conf/httpd.conf that looks similar to what I posted?
0
 

Author Comment

by:mn210
ID: 12341607
Below is the segment of Virtual Host section of httpd.conf file :
 ------------------------------------------------------------------------------
#NameVirtualHost *

#
# VirtualHost example:

# Use name-based virtual hosting.
#
#NameVirtualHost *
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

#<VirtualHost _default_:*>
#</VirtualHost>
-------------------
SSLLog      logs/ssl_engine_log
SSLLogLevel error

</IfModule>

<IfDefine HAVE_SSL>

##
## SSL Virtual Host Context
##

<VirtualHost _default_:443>

#  General setup for the virtual host
#DocumentRoot "/etc/httpd/htdocs"
#ServerName new.host.name
#ServerAdmin you@your.address
ErrorLog logs/error_log
TransferLog logs/access_log
-----------------------------------------------------------------------------------------
0
 
LVL 6

Expert Comment

by:blkline
ID: 12341746
And you currently are hosting multiple domains?  What you have here definitely does not specify virtual domains.

What does this command return?

ls -l /etc/httpd/conf.d/
0
 
LVL 6

Expert Comment

by:blkline
ID: 12341765
Also, please post the following:

grep "<VirtualHost" /etc/httpd/conf/httpd.conf
0
 

Author Comment

by:mn210
ID: 12342294
Yeah ! We are currently hosting three domains.

Here is the output  of the commands -
[shar@abc /etc]$ ls -l /etc/httpd/conf.d/
ls: /etc/httpd/conf.d/: No such file or directory
-------------------------
[shar@abc /etc]$ grep "<VirtualHost" /etc/httpd/conf/httpd.conf
# ports, in addition to the default. See also the <VirtualHost>
# See also the <VirtualHost> and Listen directives.
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
# All of these directives may appear inside <VirtualHost> containers,
# If you do not specify an ErrorLog directive within a <VirtualHost>
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# If you do not define any access logfiles within a <VirtualHost>
# define per-<VirtualHost> access logfiles, transactions will be
#<VirtualHost *>
#<VirtualHost _default_:*>
<VirtualHost _default_:443>
______________________
0
 

Author Comment

by:mn210
ID: 12434667
Still looking for help ....
0
 
LVL 6

Expert Comment

by:blkline
ID: 12434945
I was on vacation for a week and have been playing catch up... sorry for the delay.  

Would you be willing to post your httpd.conf file?  Use this command to strip out most of the junk:

cat /etc/httpd/conf/httpd.conf | sed -e '/^[ \t]*#/d' -e '/^$/d' > post_this.file

Also, please do:

ls -l /etc/httpd/conf.d

If you don't want to post this directly to the list then send just the httpd.conf file to:

   blkline at attglobal dot net  

and I'll post the salient points of it back with the answer... if I can find it in what you have provided.
0
 

Author Comment

by:mn210
ID: 12436841
As per your suggestion , I sent the httpd.conf file at your email address.
Further, I want to delete the account (web-hosting) for one of our clients? Can you please walk me thr' the steps  ?
0
 
LVL 6

Expert Comment

by:blkline
ID: 12436884
Got your file and there isn't anything in there to define your virtual hosts.  Which leads me to believe that the config file is elsewhere.  Please post the results of the following commands  (as root):

ps uxwwa

and

locate httpd.conf
0
 

Author Comment

by:mn210
ID: 12437697
Thanks a lot , it worked !!!
I got the location of httpd.conf and it  is /usr/local/apache/conf directory and also got Virtual Host domains.

Further, I want to delete the account (web-hosting) for one of our clients? Can you please walk me thr' the steps  ?
0
 
LVL 6

Accepted Solution

by:
blkline earned 250 total points
ID: 12437908
That's pretty simple:

Locate the document root for the client.  You'll want to delete that directory.
Delete all of the contents of the .conf file between <VirtualHost> and </VirtualHost>
Delete logs, if they are specific to that domain.
Remove the client's domain from your DNS, wherever that happens to be.
Restart httpd.

 <VirtualHost 192.168.1.20:80>
        ServerAdmin root@localhost
        DocumentRoot "/var/www/doc"    <-------------    this line contains the document root
        ServerName doc.mydomain.net     <-------------    this line contains the server name
        ServerAlias doc                                 <-------------    this line is basically an "a.k.a"
        ErrorLog logs/doc.mydomain-error_log
        CustomLog logs/doc.mydomain-access_log common
        <Files "*.docmgr">
                Order allow,deny
                Deny from all
        </Files>
</VirtualHost>
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question