Tried to access a Rails app on the local PC by entering in eaa via Chrome but ended up with a web search instead. How do I access the Rails app locally? Below is the Apache config for the application:
__<VirtualHost *:80> __
ServerName eaa
RailsEnv production
DocumentRoot /var/rails-apps/eaa/public
**<Directory /var/rails-apps/eaa/public> **
# Relax Apache security settings .
AllowOverride all
# MultiViews must be turned off .
Options -MultiViews
ErrorLog ${APACHE_LOG_DIR}/error.log
Had a look through the Apache error log and only found the following info message:
DocumentRoot /var/www/vhosts/tamwiki
<Directory /var/www/vhosts/tamwiki>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from 192.168
allow from 127.0.0.1
</Directory>
</VirtualHost>
Managed to access the website by adding Listen 1025 to the Apache config file, and adding an entry to the hosts file. Have used a different port for the website (in its VirtualHost entry). Port 80 is already taken by the default website.
Using a different IP address only works for a website if it is accessed remotely, not locally (on the same PC).
You can serve multiple sites from the same IP address and port if Apache is set up correctly. My virtual hosts file has this at the top:
Use name-based virtual hosting.
NameVirtualHost *:80
Also, I don’t think you want to have a single-component domain name. For example, if the site would eventually go live at eea.com, then you could set up your dev site with servername of eea.local, so that once the site is live you can access both the live site and your local site without having to change your hosts file.
Or you can eliminate a whole lot of configuration nonsense by using
Pow (http://pow.cx/) for development and simply access your app
locally as e.g. http://eaa.dev/