We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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.



43.9k

hi,

double check your app config and your webserver config

Looks like it's about nginx/apache configuration.

edited Apr '17

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



43.9k

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 Apr '17

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 Apr '17

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 Apr '17

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

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

edited Apr '17

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 Apr '17

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.

edited Apr '17

You said your 000-default.conf looks like this:

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

If your site is in /var/www/html/jpms.com and you want to use 000-default.conf, update the path there to look like this:

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

However, I would recommend you read up on configuring Apache and create a separate .conf file for your own site.



3.5k
Accepted
answer

Sorry guys for late response. I already solved the problem it's a database issue. It's about model and tables proper naming especially in query binding. Thanks for your time.