开发者

how do i use apache2 server for hosting a website?

I am using ubuntu and I have some html pages. I want to host a website from my PC at my home. How can I do 开发者_运维百科this using apache2? I am new to Apache2 if any one knows how to do this, please let me know.


The easiest way to publish HTML files with apache is by putting them in /home/your-user-name-please-do-replace-me/public_html, making sure that your apache is installed and then start apache. How to make apache start after a reboot, see this forum post on Ubuntu Forums.

When you have apache up and running, find out your servers IP-address (http://whatismyipaddress.com/ is pretty handy for this) and then your files will be accessible from: http://you-ip-address-whatever/~your-user-name-please-do-replace-me

You could always use services like http://www.dyndns.com/ so that you don't have to use your IP-address all the time.


Once apache is installed you should find that you can place content in a directory silimar to /usr/www or /usr/share/www and apache will serve it. You may also need to start apache, I don't know the ubuntu command but on fedora 12 it is:

service httpd start
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜