Ubuntu server 18.04 apache2 how to change the default page?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I will keep this short. I am trying to figure out how to change the default page for apache2 to point at my oscommerce site instead by default. I have deleted the default index.html file.
As of now I have to type:
https://myIPaddress/oscommerce/catalog
My default install location for oscommerce is:
/var/www/html/oscommerce/
What I want to type to get to the oscommerce site:
https://myIPaddress
I have created a oscommerce.conf file but I am unsure how to get apache2 to point to the site. Sorry if I am missing information. I am new to linux and I will give more information as needed.
This is what I am running into at this time
Index /
server 18.04 apache2
New contributor
RKS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I will keep this short. I am trying to figure out how to change the default page for apache2 to point at my oscommerce site instead by default. I have deleted the default index.html file.
As of now I have to type:
https://myIPaddress/oscommerce/catalog
My default install location for oscommerce is:
/var/www/html/oscommerce/
What I want to type to get to the oscommerce site:
https://myIPaddress
I have created a oscommerce.conf file but I am unsure how to get apache2 to point to the site. Sorry if I am missing information. I am new to linux and I will give more information as needed.
This is what I am running into at this time
Index /
server 18.04 apache2
New contributor
RKS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I will keep this short. I am trying to figure out how to change the default page for apache2 to point at my oscommerce site instead by default. I have deleted the default index.html file.
As of now I have to type:
https://myIPaddress/oscommerce/catalog
My default install location for oscommerce is:
/var/www/html/oscommerce/
What I want to type to get to the oscommerce site:
https://myIPaddress
I have created a oscommerce.conf file but I am unsure how to get apache2 to point to the site. Sorry if I am missing information. I am new to linux and I will give more information as needed.
This is what I am running into at this time
Index /
server 18.04 apache2
New contributor
RKS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I will keep this short. I am trying to figure out how to change the default page for apache2 to point at my oscommerce site instead by default. I have deleted the default index.html file.
As of now I have to type:
https://myIPaddress/oscommerce/catalog
My default install location for oscommerce is:
/var/www/html/oscommerce/
What I want to type to get to the oscommerce site:
https://myIPaddress
I have created a oscommerce.conf file but I am unsure how to get apache2 to point to the site. Sorry if I am missing information. I am new to linux and I will give more information as needed.
This is what I am running into at this time
Index /
server 18.04 apache2
server 18.04 apache2
New contributor
RKS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
RKS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited yesterday
RKS
New contributor
RKS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 days ago
RKSRKS
103
103
New contributor
RKS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
RKS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
RKS is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You need to change document root of apache2
leonid@DevSSD:~$ cat /etc/apache2/apache2.conf |grep DocumentRoot
leonid@DevSSD:~$ cat /etc/apache2/sites-available/000-default.conf |grep DocumentRoot
DocumentRoot /var/www/html
Above commands not find documentroot in main config, but find it in default virtualhost config, run commands and find out where this setting located. Edit file by sudo nano /etc/apache2/sites-available/000-default.conf
Change DocumentRoot to your site folder /var/www/html/oscommerce/, then restart apache2 by systemctl reload apache2
Update: Apache gives permission error in two cases, first when file permissions not allowing apache2 to read folder/file, when folder requested, e.g. / at end of request line but no index file found.
To fix file/folder permissions:
sudo chown -R youruser:www-data /var/www
sudo chmod -R u=rwX,g=rX,o= /var/www
Additionaly, if web application writes something to some folder, like templates_cache, give that folder write permissions for group.
For index type of error look for DirectoryIndex option in config files
Edited by User asking the question.
The way I fixed this issue is by changing the DocumentRoot for my site config and also creating a index.html file to redirect from the DocumentRoot to the site
Index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Refresh" content="5; URL='https://myIPaddress/oscommerce/catalog/index.php'" />
</head>
<body>
</body>
</html>
Are there index.html or index.php or some other index in /var/www/html/oscommerce/?
– LeonidMew
yesterday
Are myipaddress/catalog working? Do you have some site files outsidecatalog? What files are in /var/www/html/oscommerce/ ? You may point documentroot to /var/www/html/oscommerce/catalog but I don't know if it correct, as don't know your app structure.
– LeonidMew
yesterday
its wrong - /var/www/html/oscommerce/catalog/index.php. It should beDocumentRoot /var/www/html/oscommerce/catalog/without file name. Don't forget to restart apache after change
– LeonidMew
yesterday
What I see, you have changed DocumentRoot not correctly, may be not in all places of config. You should not see oscommerse as DocumentRoot should point above it.
– LeonidMew
yesterday
You may also do redirect by index.php file, with the following content:<?php header('Location: https://myIPaddress/oscommerce/catalog/index.php');
– LeonidMew
6 hours ago
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
});
}
});
RKS 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%2f1132521%2fubuntu-server-18-04-apache2-how-to-change-the-default-page%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
You need to change document root of apache2
leonid@DevSSD:~$ cat /etc/apache2/apache2.conf |grep DocumentRoot
leonid@DevSSD:~$ cat /etc/apache2/sites-available/000-default.conf |grep DocumentRoot
DocumentRoot /var/www/html
Above commands not find documentroot in main config, but find it in default virtualhost config, run commands and find out where this setting located. Edit file by sudo nano /etc/apache2/sites-available/000-default.conf
Change DocumentRoot to your site folder /var/www/html/oscommerce/, then restart apache2 by systemctl reload apache2
Update: Apache gives permission error in two cases, first when file permissions not allowing apache2 to read folder/file, when folder requested, e.g. / at end of request line but no index file found.
To fix file/folder permissions:
sudo chown -R youruser:www-data /var/www
sudo chmod -R u=rwX,g=rX,o= /var/www
Additionaly, if web application writes something to some folder, like templates_cache, give that folder write permissions for group.
For index type of error look for DirectoryIndex option in config files
Edited by User asking the question.
The way I fixed this issue is by changing the DocumentRoot for my site config and also creating a index.html file to redirect from the DocumentRoot to the site
Index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Refresh" content="5; URL='https://myIPaddress/oscommerce/catalog/index.php'" />
</head>
<body>
</body>
</html>
Are there index.html or index.php or some other index in /var/www/html/oscommerce/?
– LeonidMew
yesterday
Are myipaddress/catalog working? Do you have some site files outsidecatalog? What files are in /var/www/html/oscommerce/ ? You may point documentroot to /var/www/html/oscommerce/catalog but I don't know if it correct, as don't know your app structure.
– LeonidMew
yesterday
its wrong - /var/www/html/oscommerce/catalog/index.php. It should beDocumentRoot /var/www/html/oscommerce/catalog/without file name. Don't forget to restart apache after change
– LeonidMew
yesterday
What I see, you have changed DocumentRoot not correctly, may be not in all places of config. You should not see oscommerse as DocumentRoot should point above it.
– LeonidMew
yesterday
You may also do redirect by index.php file, with the following content:<?php header('Location: https://myIPaddress/oscommerce/catalog/index.php');
– LeonidMew
6 hours ago
add a comment |
You need to change document root of apache2
leonid@DevSSD:~$ cat /etc/apache2/apache2.conf |grep DocumentRoot
leonid@DevSSD:~$ cat /etc/apache2/sites-available/000-default.conf |grep DocumentRoot
DocumentRoot /var/www/html
Above commands not find documentroot in main config, but find it in default virtualhost config, run commands and find out where this setting located. Edit file by sudo nano /etc/apache2/sites-available/000-default.conf
Change DocumentRoot to your site folder /var/www/html/oscommerce/, then restart apache2 by systemctl reload apache2
Update: Apache gives permission error in two cases, first when file permissions not allowing apache2 to read folder/file, when folder requested, e.g. / at end of request line but no index file found.
To fix file/folder permissions:
sudo chown -R youruser:www-data /var/www
sudo chmod -R u=rwX,g=rX,o= /var/www
Additionaly, if web application writes something to some folder, like templates_cache, give that folder write permissions for group.
For index type of error look for DirectoryIndex option in config files
Edited by User asking the question.
The way I fixed this issue is by changing the DocumentRoot for my site config and also creating a index.html file to redirect from the DocumentRoot to the site
Index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Refresh" content="5; URL='https://myIPaddress/oscommerce/catalog/index.php'" />
</head>
<body>
</body>
</html>
Are there index.html or index.php or some other index in /var/www/html/oscommerce/?
– LeonidMew
yesterday
Are myipaddress/catalog working? Do you have some site files outsidecatalog? What files are in /var/www/html/oscommerce/ ? You may point documentroot to /var/www/html/oscommerce/catalog but I don't know if it correct, as don't know your app structure.
– LeonidMew
yesterday
its wrong - /var/www/html/oscommerce/catalog/index.php. It should beDocumentRoot /var/www/html/oscommerce/catalog/without file name. Don't forget to restart apache after change
– LeonidMew
yesterday
What I see, you have changed DocumentRoot not correctly, may be not in all places of config. You should not see oscommerse as DocumentRoot should point above it.
– LeonidMew
yesterday
You may also do redirect by index.php file, with the following content:<?php header('Location: https://myIPaddress/oscommerce/catalog/index.php');
– LeonidMew
6 hours ago
add a comment |
You need to change document root of apache2
leonid@DevSSD:~$ cat /etc/apache2/apache2.conf |grep DocumentRoot
leonid@DevSSD:~$ cat /etc/apache2/sites-available/000-default.conf |grep DocumentRoot
DocumentRoot /var/www/html
Above commands not find documentroot in main config, but find it in default virtualhost config, run commands and find out where this setting located. Edit file by sudo nano /etc/apache2/sites-available/000-default.conf
Change DocumentRoot to your site folder /var/www/html/oscommerce/, then restart apache2 by systemctl reload apache2
Update: Apache gives permission error in two cases, first when file permissions not allowing apache2 to read folder/file, when folder requested, e.g. / at end of request line but no index file found.
To fix file/folder permissions:
sudo chown -R youruser:www-data /var/www
sudo chmod -R u=rwX,g=rX,o= /var/www
Additionaly, if web application writes something to some folder, like templates_cache, give that folder write permissions for group.
For index type of error look for DirectoryIndex option in config files
Edited by User asking the question.
The way I fixed this issue is by changing the DocumentRoot for my site config and also creating a index.html file to redirect from the DocumentRoot to the site
Index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Refresh" content="5; URL='https://myIPaddress/oscommerce/catalog/index.php'" />
</head>
<body>
</body>
</html>
You need to change document root of apache2
leonid@DevSSD:~$ cat /etc/apache2/apache2.conf |grep DocumentRoot
leonid@DevSSD:~$ cat /etc/apache2/sites-available/000-default.conf |grep DocumentRoot
DocumentRoot /var/www/html
Above commands not find documentroot in main config, but find it in default virtualhost config, run commands and find out where this setting located. Edit file by sudo nano /etc/apache2/sites-available/000-default.conf
Change DocumentRoot to your site folder /var/www/html/oscommerce/, then restart apache2 by systemctl reload apache2
Update: Apache gives permission error in two cases, first when file permissions not allowing apache2 to read folder/file, when folder requested, e.g. / at end of request line but no index file found.
To fix file/folder permissions:
sudo chown -R youruser:www-data /var/www
sudo chmod -R u=rwX,g=rX,o= /var/www
Additionaly, if web application writes something to some folder, like templates_cache, give that folder write permissions for group.
For index type of error look for DirectoryIndex option in config files
Edited by User asking the question.
The way I fixed this issue is by changing the DocumentRoot for my site config and also creating a index.html file to redirect from the DocumentRoot to the site
Index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Refresh" content="5; URL='https://myIPaddress/oscommerce/catalog/index.php'" />
</head>
<body>
</body>
</html>
edited 6 hours ago
RKS
103
103
answered 2 days ago
LeonidMewLeonidMew
1,036622
1,036622
Are there index.html or index.php or some other index in /var/www/html/oscommerce/?
– LeonidMew
yesterday
Are myipaddress/catalog working? Do you have some site files outsidecatalog? What files are in /var/www/html/oscommerce/ ? You may point documentroot to /var/www/html/oscommerce/catalog but I don't know if it correct, as don't know your app structure.
– LeonidMew
yesterday
its wrong - /var/www/html/oscommerce/catalog/index.php. It should beDocumentRoot /var/www/html/oscommerce/catalog/without file name. Don't forget to restart apache after change
– LeonidMew
yesterday
What I see, you have changed DocumentRoot not correctly, may be not in all places of config. You should not see oscommerse as DocumentRoot should point above it.
– LeonidMew
yesterday
You may also do redirect by index.php file, with the following content:<?php header('Location: https://myIPaddress/oscommerce/catalog/index.php');
– LeonidMew
6 hours ago
add a comment |
Are there index.html or index.php or some other index in /var/www/html/oscommerce/?
– LeonidMew
yesterday
Are myipaddress/catalog working? Do you have some site files outsidecatalog? What files are in /var/www/html/oscommerce/ ? You may point documentroot to /var/www/html/oscommerce/catalog but I don't know if it correct, as don't know your app structure.
– LeonidMew
yesterday
its wrong - /var/www/html/oscommerce/catalog/index.php. It should beDocumentRoot /var/www/html/oscommerce/catalog/without file name. Don't forget to restart apache after change
– LeonidMew
yesterday
What I see, you have changed DocumentRoot not correctly, may be not in all places of config. You should not see oscommerse as DocumentRoot should point above it.
– LeonidMew
yesterday
You may also do redirect by index.php file, with the following content:<?php header('Location: https://myIPaddress/oscommerce/catalog/index.php');
– LeonidMew
6 hours ago
Are there index.html or index.php or some other index in /var/www/html/oscommerce/?
– LeonidMew
yesterday
Are there index.html or index.php or some other index in /var/www/html/oscommerce/?
– LeonidMew
yesterday
Are myipaddress/catalog working? Do you have some site files outside
catalog? What files are in /var/www/html/oscommerce/ ? You may point documentroot to /var/www/html/oscommerce/catalog but I don't know if it correct, as don't know your app structure.– LeonidMew
yesterday
Are myipaddress/catalog working? Do you have some site files outside
catalog? What files are in /var/www/html/oscommerce/ ? You may point documentroot to /var/www/html/oscommerce/catalog but I don't know if it correct, as don't know your app structure.– LeonidMew
yesterday
its wrong - /var/www/html/oscommerce/catalog/index.php. It should be
DocumentRoot /var/www/html/oscommerce/catalog/ without file name. Don't forget to restart apache after change– LeonidMew
yesterday
its wrong - /var/www/html/oscommerce/catalog/index.php. It should be
DocumentRoot /var/www/html/oscommerce/catalog/ without file name. Don't forget to restart apache after change– LeonidMew
yesterday
What I see, you have changed DocumentRoot not correctly, may be not in all places of config. You should not see oscommerse as DocumentRoot should point above it.
– LeonidMew
yesterday
What I see, you have changed DocumentRoot not correctly, may be not in all places of config. You should not see oscommerse as DocumentRoot should point above it.
– LeonidMew
yesterday
You may also do redirect by index.php file, with the following content:
<?php header('Location: https://myIPaddress/oscommerce/catalog/index.php');– LeonidMew
6 hours ago
You may also do redirect by index.php file, with the following content:
<?php header('Location: https://myIPaddress/oscommerce/catalog/index.php');– LeonidMew
6 hours ago
add a comment |
RKS is a new contributor. Be nice, and check out our Code of Conduct.
RKS is a new contributor. Be nice, and check out our Code of Conduct.
RKS is a new contributor. Be nice, and check out our Code of Conduct.
RKS 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%2f1132521%2fubuntu-server-18-04-apache2-how-to-change-the-default-page%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