Solved

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

Posted on 2004-10-14
14
250 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Fine Tune your automatic Updates for Ubuntu / Debian
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

911 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

22 Experts available now in Live!

Get 1:1 Help Now