My website doesn't work in digital ocean

Hi everyone! I develop a basic website in my vagrant box which is working good but after I upload in digital ocean it only shows the index page. When I go to other links (which leads to other actions and controllers) it show that the page cannot be found. Really need your helpt . Thanks guys!

Apache or Nginx? I guess its something in your server config files...

We are using DO too, and it works flawlessly. Check that your dev and prod configs are the same wherever it applies.



28.2k

hi,

double check your app config and your webserver config

Looks like it's about nginx/apache configuration.

edited 1d ago

I have already enabled mod_rewrite. And here's my /etc/apache2/sites-available/000-default.conf

<Directory /var/www/html> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory>

still not working.. need help guys. Help is much appreciated. thank you



28.2k

Hi,

I also have got an "Allow from all" directive in my apache config.

Also, when following a link in your app, does the url looks like you expect ?

I have already enabled mod_rewrite. And here's my /etc/apache2/sites-available/000-default.conf

<Directory /var/www/html> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory>

still not working.. need help guys. Help is much appreciated. thank you

You shouldn't be using the default virtual host file. You need to make one specifically for your site. This tutorial is pretty good: https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04

edited 19h ago

My urls looks good. I followed the instructions on the link but it still not working. Is there a step by step tutorial on how to upload Phalcon app to Digital Ocean? with proper configuration? (Note: I don't have domain yet.) Thanks again.

This is not about phalcon, as i already told, nginx/apache configuration, post your vhost configuration and htaccess.

edited 9h ago

I dont know if I'm doing this correctly I just followed the link that you gave me about vhost, then I followed Phalcon's documentation about htaccess. Im a beginners on this. It's my first time to use phalcon and upload to digital ocean. Thank you!

#.htaccess
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^$ public/ [L]
    RewriteRule (.*) public/$1 [L]
</IfModule>

#public/.htaccess
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</IfModule>

#heres my vhost file
<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName jpms.com
    ServerAlias www.jpms.com
    DocumentRoot /var/www/html/jpms.com
    DirectoryIndex index.php
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    <Directory /var/www/html/jpms.com>
        Options All
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
edited 8h ago

http://www.jpms.com - this domain doesn't seem work.

Also you sure your website is under this directory /var/www/html/jpms.com ?

edited 8h ago

yep. I haven't bought it yet. That's why I use it in localhost as per advice by the link that you gave me. Yes, my website is in the correct directory. Is there anything wrong with my configuration? Thank you.

edited 7h ago

Idk, just best check logs of apache what error you have? Maybe it's about permissions? You just better go on stackoverflow with this problem because it's not phalcon at all.