I have dedicated server web hosting in Hostgator. - CentOs 6 64bit - Dedicated Server - Apache I had an dedicated host IP where I have created "A" record with IP(domain hosting is in GoDaddy).
My problem is creating virtual host to point rails app to my domain. I am trying to configure domain. I didn't find conf file where default document root is configured. I tried changing conf file in etc/httpd/conf/httpd.conf, but no use. Some default document root(/usr/local/apache/htdocs) page is rendering. I need to find the document root virtual configuration and then need to point my domain to that. I need help regarding this.
Here is my default virtualhost setting in httpd conf file:
NameVirtualHost *
# Default vhost for unbound IPs
<VirtualHost *>
ServerName examle_server_name
DocumentRoot /usr/local/apache/htdocs
ServerAdmin root@example_server
<IfModule mod_suphp.c>
suPHP_UserGroup nobody nobody
</IfModule>
</VirtualHost>
Even if I change Server name to my domain name there is no chnage. Also if I remove those lines, it is showing default page which is in /usr/local/apache/htdocs.
How/Where can I change this to effect/point my rails app to domain.
Also I need Apache VirtualHost settings of rails app configuration which is running on rails 3000 port
Help me please.
Regards, Ranjit
For deploying apps in a server I use this virtual host configuration
<VirtualHost *:80>
ServerName mydomain.com
DocumentRoot /path/to/rails/public/folder
<Directory /path/to/rails/public/folder >
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
I creata a file in /etc/apache2/sites-enabled/mysite.conf
, but I do it in Ubuntu servers. I donn't know if the location in CentOS is the same.
You can create another file like this for the 3000 port app.
I skipped the Passengger (https://www.phusionpassenger.com/) settings in the file. I use it for serving rails apps.
After any changes you will need to restart the server
sudo service apache2 restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With