开发者

how can i park a domain on a centOS

how can i park a domain on开发者_运维问答 CentOS based VPS without any Cpanel(cPanel,plesk or ...) and using shh?


You can edit httpd.conf and where it says the ServerName part under the virtual hosts section, you can add your domain there. If your DNS isnt pointing to your web server, you will need to do that too (this is one of the advantages of cpanel etc it does it for you but then at the same time, leaves you wondering what it did)

Something like

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /www/docs/dummy-host.example.com
    ServerName dummy-host.example.com
    ServerName test.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>


I assume you have DNS (ie. Godaddy's, or you get one with your VPS).

Edit you file /etc/httpd/conf/httpd.conf

Add this at the bottom (use your domain name as ServerName and your folder as DocumentRoot):

<VirtualHost *:80>
ServerAdmin root@localhost
DocumentRoot /home/examplecom/www/
ServerAlias example.com
ServerName www.example.com
ErrorLog logs/www.example.com-error_log
CustomLog logs/www.example.com-access_log common
    <Directory /home/examplecom/www/>
            Options FollowSymLinks
            AllowOverride All
    </Directory>
</VirtualHost>

Directory is optional, but this works for me.

Than go to SSH as a "root" and reset Apache server:

service httpd restart
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜