I’m trying to do a migration and I’m not able to get anything but the main site page to load. We’re using the LAMP stack and a modified version of the CodeIgniter framework.
Our company purchased a dedicated server with a url they provided as http://ns107.ip-41-71-142.us/
(we haven’t yet purchased the new domain we’ll be using for our business yet). The public IP they provided is 41.71.142.15
(These domains and ips are not the real one.)
We’re trying to test with this url/ip because we’ll be using the same actual business domain – we’re just switching servers, not domain names.
The VirtualHost configuration is below (I’ve commented out ServerAlias because I’m trying to get it working with just the server). Also, these virtual hosts are defined in a file named ssl.conf
with additional ssl configuration that I think isn’t the reason the 404 error is happening (I’m able to start apache, and even though the ssl config isn’t correct, as it was for the old server that we’re migrating from, that should only cause a cert error warning on the browser (?))
<VirtualHost *:80>
ServerName ns107.ip-41-71-142.us
#ServerAlias ns107.ip-41-71-142.us, ip-41-71-142.us
DocumentRoot /var/www/app/current/public/
LogLevel warn
ErrorLog /var/log/httpd/error.log
CustomLog /var/log/httpd/access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerName ns107.ip-41-71-142.us
#ServerAlias ns107.ip-41-71-142.us, ip-41-71-142.us
DocumentRoot /var/www/app/current/public/
ErrorLog /var/log/httpd/error.log
CustomLog /var/log/httpd/access.log combined
TransferLog logs/ssl_access_log
LogLevel warn
</VirtualHost>
/etc/hosts file:
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.0.1 ns107.ip-41-71-142.us ns107
/etc/hostname
ns107.ip-41-71-142.us
/etc/httpd/conf/httpd.conf
(I’ve disabled all the .htaccess files with the AllowOverride None
and am allowing access from everywhere with Require all granted
(??))
<Directory "/var/www">
AllowOverride None
# Allow open access:
Require all granted
</Directory>
Things I’ve tried in addition to the steps above:
- Running
apachectl -D DUMP_VHOSTS
with the output
Blockquote
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using ns107.ip-41-71-142.us. Set the ‘ServerName’ directive globally to suppress this message
VirtualHost configuration:
*:80 ns107.ip-41-71-142.us (/etc/httpd/conf.d/ssl.conf:56)
*:443 ns107.ip-41-71-142.us (/etc/httpd/conf.d/ssl.conf:71)
I saw on another post that this is just a warning and not an error, meaning that the VirtualHost configuration is still being picked up?
2. I’ve tried checking theerror_log
file but I’m only getting the same warning shown above.
Actual behavior:
When I type in the url ns107.ip-41-71-142.us
into the browser, I reach the main index page with no errors, but the redirect to user/login, which is located in the users_controller fails and returns a 404 error. It seems as if I’m only able to access the main index page and nothing else.
Expected behavior:
Routes other than the main route load with no errors.
Thanks so much for your help.
2
Answers
I solved the problem by including an .htaccess file that was not part of the git repository from which I cloned.
You can use link that,
I already applied on my server site project.
But if you check it on localhost 443 might not work.