Solved

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

Posted on 2004-10-14
14
244 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
 
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
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now