Why it visit the Apache2 Default page rather than the home page after entering the URL

I bought a Ali Cloud ECS server at Alibaba.And i try to migrated my site onto it.I configured LAMP,tared my site at the previous server and post it into my new server.I get MySql tables creation done and connection done. Finally i can visit my website via url: ip/directoryname.

But there is a problem: If i type in the ip address only,instead of going to the homepage,i go to the Apache2 default page.How can i reach the homepage directly via ip address instead of the whole url which includes the directory.

It is because there is a index.html in your Apache2’s root directory which Apache2 would visit after you enter the website address.

So try to modify the default page.

At first i modified the file located at /etc/apache2/sites-available/0000-default.conf,and change /var/www/html to /var/www/html/mysite. In this way, i did visit homepage directly but i can’t visit other page of via the homepage.The reason is that Apache failed to get the path or permission denied.

Then i came out with another idea:remove index.html or rename it.In this way,you will not go to the index.html page,but u will not go to the homepage either.

The third idea came, modify the document called dir.conf at /etc/apache2/mods-enabled/dir.conf. dir.conf is a essential configuration document to appoint a page you want if Apache failed to index the default page.Or u can set ur homepage as the default page.

Delete ‘index.html’,and add ur site’s filename into it.

No Comments

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
Previous
Next