unable to browse the server throught apache
I am using apache server I typed everything is correct, but when I tried to browse the apache server through by applying server IP address. it's showing 404 not found. I don't know where I type wrong please help me.
step 1:-
[root@server httpd]# ll
total 16
-rw-r--r--. 1 root root 0 Mar 7 13:06 access_log
-rw-r--r--. 1 root root 203 Mar 10 23:39 apachi1
-rw-r--r--. 1 root root 0 Mar 10 23:35 apachi1-error_log
-rw-r--r--. 1 root root 0 Mar 10 23:31 apachi2
-rw-r--r--. 1 root root 0 Mar 10 11:39 e1-error_log
-rw-r--r--. 1 root root 4444 Mar 10 23:35 error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_access_log
-rw-r--r--. 1 root root 356 Mar 10 23:35 ssl_error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_request_log
step 2:-
[root@server ~]# cd /var/www/html/
[root@server html]# ll
total 12
-rw-r--r--. 1 root root 48 Mar 10 23:33 home3.com
-rw-r--r--. 1 root root 35 Mar 10 11:37 host.com
-rw-r--r--. 1 root root 146 Mar 7 13:10 index.html
step 3:- under this config file I write this virtual host
[root@server ~]# cat /etc/httpd/conf/httpd.conf
<VirtualHOst *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/home3.com
ServerName 192.168.37.132
ErrorLog /var/log/httpd/apachi1-error_log
CustomLog /var/log/httpd/apachi1 combined
</VirtualHost>
My IP address is also correct when I tried accessing it with CURL
[root@server ~]# curl http://192.168.37.132
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL / was not found on this server.</p>
</body></html>
apache2
New contributor
add a comment |
I am using apache server I typed everything is correct, but when I tried to browse the apache server through by applying server IP address. it's showing 404 not found. I don't know where I type wrong please help me.
step 1:-
[root@server httpd]# ll
total 16
-rw-r--r--. 1 root root 0 Mar 7 13:06 access_log
-rw-r--r--. 1 root root 203 Mar 10 23:39 apachi1
-rw-r--r--. 1 root root 0 Mar 10 23:35 apachi1-error_log
-rw-r--r--. 1 root root 0 Mar 10 23:31 apachi2
-rw-r--r--. 1 root root 0 Mar 10 11:39 e1-error_log
-rw-r--r--. 1 root root 4444 Mar 10 23:35 error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_access_log
-rw-r--r--. 1 root root 356 Mar 10 23:35 ssl_error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_request_log
step 2:-
[root@server ~]# cd /var/www/html/
[root@server html]# ll
total 12
-rw-r--r--. 1 root root 48 Mar 10 23:33 home3.com
-rw-r--r--. 1 root root 35 Mar 10 11:37 host.com
-rw-r--r--. 1 root root 146 Mar 7 13:10 index.html
step 3:- under this config file I write this virtual host
[root@server ~]# cat /etc/httpd/conf/httpd.conf
<VirtualHOst *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/home3.com
ServerName 192.168.37.132
ErrorLog /var/log/httpd/apachi1-error_log
CustomLog /var/log/httpd/apachi1 combined
</VirtualHost>
My IP address is also correct when I tried accessing it with CURL
[root@server ~]# curl http://192.168.37.132
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL / was not found on this server.</p>
</body></html>
apache2
New contributor
1
I guess this is PHP. Please share the sample code you are trying to run and also any errors that may arise. You can run in terminaltail -f /var/log/apache2/*.log
the refresh the page. Edit your question and share the output with us.
– Parto
Mar 10 at 17:55
add a comment |
I am using apache server I typed everything is correct, but when I tried to browse the apache server through by applying server IP address. it's showing 404 not found. I don't know where I type wrong please help me.
step 1:-
[root@server httpd]# ll
total 16
-rw-r--r--. 1 root root 0 Mar 7 13:06 access_log
-rw-r--r--. 1 root root 203 Mar 10 23:39 apachi1
-rw-r--r--. 1 root root 0 Mar 10 23:35 apachi1-error_log
-rw-r--r--. 1 root root 0 Mar 10 23:31 apachi2
-rw-r--r--. 1 root root 0 Mar 10 11:39 e1-error_log
-rw-r--r--. 1 root root 4444 Mar 10 23:35 error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_access_log
-rw-r--r--. 1 root root 356 Mar 10 23:35 ssl_error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_request_log
step 2:-
[root@server ~]# cd /var/www/html/
[root@server html]# ll
total 12
-rw-r--r--. 1 root root 48 Mar 10 23:33 home3.com
-rw-r--r--. 1 root root 35 Mar 10 11:37 host.com
-rw-r--r--. 1 root root 146 Mar 7 13:10 index.html
step 3:- under this config file I write this virtual host
[root@server ~]# cat /etc/httpd/conf/httpd.conf
<VirtualHOst *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/home3.com
ServerName 192.168.37.132
ErrorLog /var/log/httpd/apachi1-error_log
CustomLog /var/log/httpd/apachi1 combined
</VirtualHost>
My IP address is also correct when I tried accessing it with CURL
[root@server ~]# curl http://192.168.37.132
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL / was not found on this server.</p>
</body></html>
apache2
New contributor
I am using apache server I typed everything is correct, but when I tried to browse the apache server through by applying server IP address. it's showing 404 not found. I don't know where I type wrong please help me.
step 1:-
[root@server httpd]# ll
total 16
-rw-r--r--. 1 root root 0 Mar 7 13:06 access_log
-rw-r--r--. 1 root root 203 Mar 10 23:39 apachi1
-rw-r--r--. 1 root root 0 Mar 10 23:35 apachi1-error_log
-rw-r--r--. 1 root root 0 Mar 10 23:31 apachi2
-rw-r--r--. 1 root root 0 Mar 10 11:39 e1-error_log
-rw-r--r--. 1 root root 4444 Mar 10 23:35 error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_access_log
-rw-r--r--. 1 root root 356 Mar 10 23:35 ssl_error_log
-rw-r--r--. 1 root root 0 Mar 10 23:35 ssl_request_log
step 2:-
[root@server ~]# cd /var/www/html/
[root@server html]# ll
total 12
-rw-r--r--. 1 root root 48 Mar 10 23:33 home3.com
-rw-r--r--. 1 root root 35 Mar 10 11:37 host.com
-rw-r--r--. 1 root root 146 Mar 7 13:10 index.html
step 3:- under this config file I write this virtual host
[root@server ~]# cat /etc/httpd/conf/httpd.conf
<VirtualHOst *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/home3.com
ServerName 192.168.37.132
ErrorLog /var/log/httpd/apachi1-error_log
CustomLog /var/log/httpd/apachi1 combined
</VirtualHost>
My IP address is also correct when I tried accessing it with CURL
[root@server ~]# curl http://192.168.37.132
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL / was not found on this server.</p>
</body></html>
apache2
apache2
New contributor
New contributor
edited Mar 11 at 8:24
Dan
7,10934573
7,10934573
New contributor
asked Mar 10 at 17:52
dhanushdhanush
32
32
New contributor
New contributor
1
I guess this is PHP. Please share the sample code you are trying to run and also any errors that may arise. You can run in terminaltail -f /var/log/apache2/*.log
the refresh the page. Edit your question and share the output with us.
– Parto
Mar 10 at 17:55
add a comment |
1
I guess this is PHP. Please share the sample code you are trying to run and also any errors that may arise. You can run in terminaltail -f /var/log/apache2/*.log
the refresh the page. Edit your question and share the output with us.
– Parto
Mar 10 at 17:55
1
1
I guess this is PHP. Please share the sample code you are trying to run and also any errors that may arise. You can run in terminal
tail -f /var/log/apache2/*.log
the refresh the page. Edit your question and share the output with us.– Parto
Mar 10 at 17:55
I guess this is PHP. Please share the sample code you are trying to run and also any errors that may arise. You can run in terminal
tail -f /var/log/apache2/*.log
the refresh the page. Edit your question and share the output with us.– Parto
Mar 10 at 17:55
add a comment |
1 Answer
1
active
oldest
votes
From the ll
command you posted, it seems that home3.com
is a file, and not a directory.
While the DocumentRoot
directive is /var/www/html/home3.com
.
So when accessing that IP, Apache is trying to load /var/www/html/home3.com/index.html
which does not exist, hence the 404 error.
You need to change the DocumentRoot
directive to /var/www/html
, and access the page with http://192.168.37.132/home3.com
instead. Or make home3.com
a directory, and create an index file inside that directory.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
dhanush is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1124576%2funable-to-browse-the-server-throught-apache%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
From the ll
command you posted, it seems that home3.com
is a file, and not a directory.
While the DocumentRoot
directive is /var/www/html/home3.com
.
So when accessing that IP, Apache is trying to load /var/www/html/home3.com/index.html
which does not exist, hence the 404 error.
You need to change the DocumentRoot
directive to /var/www/html
, and access the page with http://192.168.37.132/home3.com
instead. Or make home3.com
a directory, and create an index file inside that directory.
add a comment |
From the ll
command you posted, it seems that home3.com
is a file, and not a directory.
While the DocumentRoot
directive is /var/www/html/home3.com
.
So when accessing that IP, Apache is trying to load /var/www/html/home3.com/index.html
which does not exist, hence the 404 error.
You need to change the DocumentRoot
directive to /var/www/html
, and access the page with http://192.168.37.132/home3.com
instead. Or make home3.com
a directory, and create an index file inside that directory.
add a comment |
From the ll
command you posted, it seems that home3.com
is a file, and not a directory.
While the DocumentRoot
directive is /var/www/html/home3.com
.
So when accessing that IP, Apache is trying to load /var/www/html/home3.com/index.html
which does not exist, hence the 404 error.
You need to change the DocumentRoot
directive to /var/www/html
, and access the page with http://192.168.37.132/home3.com
instead. Or make home3.com
a directory, and create an index file inside that directory.
From the ll
command you posted, it seems that home3.com
is a file, and not a directory.
While the DocumentRoot
directive is /var/www/html/home3.com
.
So when accessing that IP, Apache is trying to load /var/www/html/home3.com/index.html
which does not exist, hence the 404 error.
You need to change the DocumentRoot
directive to /var/www/html
, and access the page with http://192.168.37.132/home3.com
instead. Or make home3.com
a directory, and create an index file inside that directory.
answered Mar 11 at 10:11
DanDan
7,10934573
7,10934573
add a comment |
add a comment |
dhanush is a new contributor. Be nice, and check out our Code of Conduct.
dhanush is a new contributor. Be nice, and check out our Code of Conduct.
dhanush is a new contributor. Be nice, and check out our Code of Conduct.
dhanush is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1124576%2funable-to-browse-the-server-throught-apache%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I guess this is PHP. Please share the sample code you are trying to run and also any errors that may arise. You can run in terminal
tail -f /var/log/apache2/*.log
the refresh the page. Edit your question and share the output with us.– Parto
Mar 10 at 17:55