NameVirtualHost CentOS 6

haringsrob

Verified User
Joined
Sep 30, 2011
Messages
22
Hello,

I'm setting up my verry first server with centos and DA.

Now i have one issue wich i cant resolve.

Code:
Starting httpd: [Fri Sep 30 11:20:37 2011] [error] (EAI 2)Name or service not known: Could not resolve host name : -- ignoring!
[Fri Sep 30 11:20:39 2011] [error] (EAI 2)Name or service not known: Could not resolve host name : -- ignoring!

I have tried a few things. But nothing seems to work.

I'm only have One ip.

Any help is welcome.
Rob
 
post output for:

Code:
cat /etc/hosts

Code:
hostname

Regards

Have solved this problem.

Now when i add a domain in my user level of directadmin and i go to this domain only:

Apache is functioning normally

shows up.

Tried a few things but noting seems to work.
 
Try manually restart apache.

Check also if in

/usr/local/directadmin/data/users/USERNAME/httpd.conf

there is a correct configuration.

Seems or that apache isnt restart or that the new httpd.conf is not loaded (or not craeted).

Regards
 
This is my httpd.conf file of my user:

##MYIP## is my public ip
Code:
<VirtualHost ##MYIP##:80 >


    ServerName www.y0o.nl
    ServerAlias www.y0o.nl y0o.nl 
    ServerAdmin [email protected]
    DocumentRoot /home/admin/domains/y0o.nl/public_html
    ScriptAlias /cgi-bin/ /home/admin/domains/y0o.nl/public_html/cgi-bin/

    UseCanonicalName OFF

    SuexecUserGroup admin admin
    CustomLog /var/log/httpd/domains/y0o.nl.bytes bytes
    CustomLog /var/log/httpd/domains/y0o.nl.log combined
    ErrorLog /var/log/httpd/domains/y0o.nl.error.log

    <Directory /home/admin/domains/y0o.nl/public_html>
        Options +Includes -Indexes

        php_admin_flag engine ON
        <IfModule !mod_php6.c>
            php_admin_flag safe_mode OFF
        </IfModule>
        php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'


        php_admin_value open_basedir /home/admin/:/tmp:/var/tmp:/usr/local/lib/php/


    </Directory>



</VirtualHost>

This is output of
service httpd restart

Code:
Stopping httpd:                                            [  OK  ]
Starting httpd:

I noticed that starting httpd is not showing OK ?

Thank you for helping so far
 
Actually hide an ip and leave the host visible have no sense.. but ok...

check if apache is running

or

Code:
/etc/init.d/httpd status

or

Code:
ps aux | grep httpd

Let me know
 
Check the httpd logs and directadmin logs for errors in /var/log please

Let me know if you find any error or something wrong
 
Access log shows the following:

###ip### - - [30/Sep/2011:14:55:57 +0200] "GET / HTTP/1.1" 200 394

Error log show this:

[Fri Sep 30 14:55:00 2011] [error] [client ###ip### ] File does not exist: /var/www/html/~y0o.nl
[Fri Sep 30 14:55:00 2011] [error] [client ###ip### ] File does not exist: /var/www/html/404.shtml

The rest of logs seem normal.
 
Before we go to that, i did have on thing that didnt work troughtout the installation, sorry but i totally forgot about this.

You can automate this process with:
cd /usr/local/directadmin/data/templates/custom
cp ../dns_a.conf .
and add:
|?IP=192.168.1.2|
to the top of the custom/dns_a.conf file.

There is no such file as dns_a.conf

Once again sorry
 
Hello,

I need to add it becouse i'm using a nat rule to get to my server.

I managed to get my website working

had to edit my users httpd.conf file IP to my local ip then i can access it.

However when i delete my domain and recreate it, it still takes my public ip.

Any experience on how to edit that it always uses my local ip?

Thanks in advance.
 
Ok, now you gave the real needed information.

For do that you need to do this:

Code:
cp /usr/local/directadmin/data/templates/virtual_host2* /usr/local/directadmin/data/templates/custom/



Once you did this edit all virtual_host2* file in custom directory and change IP with the internal IP.

Regards
 
For now its working, going to try add other packages and domains now.


Thanks alot for your help!
 
One more issue.

I have addad a second domain to my admin user, user level.

When i visit that domain it goes to the first domain i have added roots directory

(it show y0o.nl's welcome screen instead of other domains)
 
Hello, and good morning.

These are the file contents.

Code:
<VirtualHost 192.168.12.250:80 >


	ServerName www.y0o.nl
	ServerAlias www.y0o.nl y0o.nl 
	ServerAdmin [email protected]
	DocumentRoot /home/admin/domains/y0o.nl/public_html
	ScriptAlias /cgi-bin/ /home/admin/domains/y0o.nl/public_html/cgi-bin/

	UseCanonicalName OFF

	SuexecUserGroup admin admin
	CustomLog /var/log/httpd/domains/y0o.nl.bytes bytes
	CustomLog /var/log/httpd/domains/y0o.nl.log combined
	ErrorLog /var/log/httpd/domains/y0o.nl.error.log

	<Directory /home/admin/domains/y0o.nl/public_html>
		Options +Includes -Indexes

		php_admin_flag engine ON
		<IfModule !mod_php6.c>
			php_admin_flag safe_mode OFF
		</IfModule>
		php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'


		php_admin_value open_basedir /home/admin/:/tmp:/var/tmp:/usr/local/lib/php/


	</Directory>



</VirtualHost>



<VirtualHost 192.168.12.250:80 >


	ServerName www.vrouwenkapsel.nl
	ServerAlias www.vrouwenkapsel.nl vrouwenkapsel.nl 
	ServerAdmin [email protected]
	DocumentRoot /home/admin/domains/vrouwenkapsel.nl/public_html
	ScriptAlias /cgi-bin/ /home/admin/domains/vrouwenkapsel.nl/public_html/cgi-bin/

	UseCanonicalName OFF

	SuexecUserGroup admin admin
	CustomLog /var/log/httpd/domains/vrouwenkapsel.nl.bytes bytes
	CustomLog /var/log/httpd/domains/vrouwenkapsel.nl.log combined
	ErrorLog /var/log/httpd/domains/vrouwenkapsel.nl.error.log

	<Directory /home/admin/domains/vrouwenkapsel.nl/public_html>
		Options +Includes -Indexes

		php_admin_flag engine ON
		<IfModule !mod_php6.c>
			php_admin_flag safe_mode OFF
		</IfModule>
		php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'


		php_admin_value open_basedir /home/admin/:/tmp:/var/tmp:/usr/local/lib/php/


	</Directory>



</VirtualHost>
 
Back
Top