Apache is functioning normally

ajax20

Verified User
Joined
Jul 16, 2014
Messages
142
Hi

I know this question has already been asked by various users but, unfortunately, the answers given to those questions have not been very helpful to me.

I have recently bought a VPS service with Direct Admin already installed on it. The problem I have is when I enter the IP address, the message "Apache is functioning normally" appears on a white background in the browser but when I enter the domain name I can access my website. I asked the reason for that and the company staff told me I need to have a dedicated IP address for my Direct Admin panel, but I just can not understand the reason. I already have an IP for my website on which my domain is set, so what is the reason for having a dedicated IP address??

Please be kind and help me understand the reason as I do not see the necessity fort having an additional IP.

Many thanks
 
Hello,

If you are going to host only one web-site on a server with a single IP address, and if you want your site be accessed by that IP, then you may achieve the desired the following way:

Modify file /etc/httpd/conf/extra/httpd-vhosts.conf
Change

Code:
DocumentRoot /var/www/html

to

Code:
DocumentRoot /home/userbob/domains/domain.com/public_html

where replace userbob and domain.com with your actual username and domain.

Note to change them only within sections:

Code:
<VirtualHost 11.22.33.44:80>
...
...
...
</VirtualHost>


Code:
<VirtualHost 11.22.33.44:443>
...
...
...
</VirtualHost>


where 11.22.33.44 should be your server IP.

Then run

Code:
chattr +i /etc/httpd/conf/extra/httpd-vhosts.conf

and restart apache.
 
Solved!

Thank you very much zEitEr! That did it.
Yes, I just need that one site on the whole VPS. I wonder why the VPS guys did not let me know about that solution? Anyways, it was really helpful. Thanks again
 
I would recommend not using "chattr +i" on any configuration files. Please do the following instead of it now:
Code:
chattr -i /etc/httpd/conf/extra/httpd-vhosts.conf
mkdir -p /usr/local/directadmin/custombuild/custom/ap2/conf/extra
cp -p /etc/httpd/conf/extra/httpd-vhosts.conf /usr/local/directadmin/custombuild/custom/ap2/conf/extra/httpd-vhosts.conf
 
Can you explain the difference?

Hello smtalk

Thanks for replying.

I saw you post just today and have already applied the above changes. Could you please explain why I need to add those directives. I'll be thankful if you explain about the difference.

Many thanks
 
The both ways would end the same. My way you protect file against beign overwritten, the way Martynas suggested it the file will be overwritten by a modified copy of the file (when overwriting is needed). So whatever you choose in the end you'll still have the modified file to let the things work as you want.
 
Anybody could explain the difference?

The difference is that file could still be modified again without "chattr -i", and if there would be any critical code, CustomBuild could still add it to the file (usually, customized files are not touched, but some of them are, just to make things work). One of such files is /etc/httpd/conf/extra/httpd-phpmodules.conf.
 
The reverse

Hi

I am curious to know what I should do if I decide to do the opposite of my original plan. I mean aside from changing

Code:
DocumentRoot /home/userbob/domains/domain.com/public_html

back to

Code:
DocumentRoot /var/www/html

in

Code:
/etc/httpd/conf/extra/httpd-vhosts.conf

Do I need to run the following again?

Code:
chattr +i /etc/httpd/conf/extra/httpd-vhosts.conf


Thanks
 
solved

Solved!

I had to first run

Code:
chattr -i /etc/httpd/conf/extra/httpd-vhosts.conf

Make my changes.

then run

Code:
chattr +i /etc/httpd/conf/extra/httpd-vhosts.conf
 
The reason for the original chattr +i command was to keep DirectAdmin from managing the file. If the file is back to normal and DirectAdmi can again manage it, you can leave the chattr -i setting.
Jeff
 
Hi friends
I have same problem but i installed Lite speed on CentOS and Directadmin. when i refer to ip server web browser talk "apache is functioning normally" what can i do lite speed index appear instead this sentence.
Many thanks
 
Hello,

Create an user with a domain, and change hostname to server.domain.com instead of domain.com.

p.s. this is my guess, I don't know your real situation. And here domain.com is just an example a domain name, and you should use your won domain instead.
 
Nginx is functioning normally

you gave explanation about apache but i install nginx Instead of Apache and i have Error Nginx is functioning normally and i want my website open by ip address
i try change this file /etc/httpd/conf/extra/httpd-vhosts.conf but This file does not exist

please help
 
With NGINX as a standalone server you should update settings in /usr/local/directadmin/custombuild/configure/nginx/conf/nginx-vhosts.conf and copy them to /usr/local/directadmin/custombuild/custom/nginx/conf/

then run
Code:
./build rewrite_confs
 
new error 404 Not Found nginx

With NGINX as a standalone server you should update settings in /usr/local/directadmin/custombuild/configure/nginx/conf/nginx-vhosts.conf and copy them to /usr/local/directadmin/custombuild/custom/nginx/conf/

then run
Code:
./build rewrite_confs

i have a new error 404 Not Found nginx my website made by wordpress and main language is persian

Please help to solve this problem
 
I need to see your configs and error logs. Without it I don't have anything to suggest other than reset to defaults and try again or get somebody to do it for you.
 
404 Not Found nginx

I need to see your configs and error logs. Without it I don't have anything to suggest other than reset to defaults and try again or get somebody to do it for you.

nginx-vhosts.conf file

server {
listen |IP|:|PORT_80|;
listen 127.0.0.1:|PORT_80|;
listen [::1]:|PORT_80|;
|LINKEDIP|
server_name $hostname |IP|;

root /home/www/public_html;
index index.html index.htm index.php;

include /etc/nginx/nginx-userdir.conf;

# Pass all .php files onto a php-fpm/php-fcgi server.
location ~ \.php$ {
try_files $uri =404;

fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_nam$
fastcgi_pass unix:/usr/local/php54/sockets/webapps.sock;
}

include /etc/nginx/nginx-info.conf;
include /etc/nginx/webapps.conf;
}

# HTTPS server
#
server {
listen |IP|:|PORT_443| ssl;
listen 127.0.0.1:|PORT_443| ssl;
listen [::1]:|PORT_443| ssl;
|LINKEDIPSSL|
server_name $hostname |IP|;

ssl on;
ssl_certificate /etc/nginx/ssl.crt/server.crt.combined;
ssl_certificate_key /etc/nginx/ssl.key/server.key;

root /home/www/public_html;
index index.html index.htm index.php;

include /etc/nginx/nginx-userdir.conf;

# Pass all .php files onto a php-fpm/php-fcgi server.
location ~ \.php$ {
# try_files $uri/ =404;

fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_nam$
fastcgi_pass unix:/usr/local/php54/sockets/webapps.sock;
}

include /etc/nginx/nginx-info.conf;
include /etc/nginx/webapps.ssl.conf;

}
 
Back
Top