Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't get the web app running #25

Open
carlos2727 opened this issue Jun 14, 2018 · 9 comments
Open

can't get the web app running #25

carlos2727 opened this issue Jun 14, 2018 · 9 comments

Comments

@carlos2727
Copy link

Hi, for some reason I can't get this running on my server.

I have a regular apache server with php 7.2.6 (because the symfony requirements states that it needs 7.1.3)
I carefully read the installation details and here's what happens..

  • installed symfony ,composer, npm, bower, gulp
  • run symfony checker "composer require symfony/requirements-checker" = all pass
  • run first command to clear cache "php bin/console cache:clear --env=prod" and I get the following error

// Clearing the cache for the prod environment with debug false
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/html/wc/vendor/symfony/monolog-bundle/DependencyInjection/Configuration.php on line 627
[Doctrine\DBAL\Exception\ConnectionException]
An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)
[PDOException]
SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

I then tried to run the following commands from your doc (Create your admin user, Give yourself Admin access..) and keep getting the same error without the php warning count.

Please help, I would like to have this running asap.
Thanks!

@aminvakil
Copy link
Contributor

As I see in your error log you're trying to connect to database via root user which it's not correct and secure.
You should create a specific user for sportify in your mysql using this command:

create database sportify;
CREATE USER 'sportify_usr'@'%' IDENTIFIED BY 'something-really-random';
GRANT ALL ON sportify.* TO 'sportify_usr'@'%';
FLUSH PRIVILEGES;
exit

You can also check the full wiki in this link:
https://github.com/dev-labs-bg/sportify/wiki/Setting-up-the-project-on-DigitalOcean-droplet-from-A-to-Z

@carlos2727
Copy link
Author

@aminvakil Thanks for the quick reply, I was able to fix this by creating a different user than root and setting the permission to the table, I also had to go to /app/config/parameters.yml to enter the correct values for the db.

Now after entering the commands to create users for the admin section I try to navigate to the folder where I created the project /project/web/ and I'm getting a blank page.. nothing loads it's an empty doc
If I try /web/config.php (I left it there to test) it's showing the page where all validation have passed.
I'm not sure what I'm missing...

@aminvakil
Copy link
Contributor

Make sure apache has permissions to execute files created by sportify and make sure www-data user is owner of your file and also make sure .htaccess is enabled.
Also try http://YOUR_IP/app_dev.php, if it says
You are not allowed to access this file. Check app_dev.php for more information.
Try http://localhost/app_dev.php
As it can show you errors from symphony.

@cmihaylov
Copy link
Member

Please make sure that your apache web server config has document root set to: <project_folder>/web

@carlos2727
Copy link
Author

carlos2727 commented Jun 15, 2018

@aminvakil

  • permission is currently set to 0775 for almost all files.
  • www-data is set for all folders and files
  • app_dev.php is currently returning
    You are not allowed to access this file. Check app_dev.php for more information.

I installed this on a server with a specific ip. So I don't think I can use localhost/app_dev.php, it has to be with the correct ip.

Here's the folder structure of what's on the server (I have multiple sites under the html folder)
var/www/html/site1
var/www/html/site2
...

@cmihaylov since I have multiple websites running on the same server, I guess I can't really set doc root to project_folder -> /web right?

thanks for the help!

@aminvakil
Copy link
Contributor

aminvakil commented Jun 15, 2018

<VirtualHost abc.xyz:80>
        ServerName abc.xyz
        ServerAdmin [email protected]
        DocumentRoot /var/www/html/web
        <Directory /var/www/html/web/>
               Options FollowSymLinks MultiViews
               AllowOverride All
               Order allow,deny
               allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

@cmihaylov
Copy link
Member

If you have multiple sites running on the same server then you probably have virtual hosts set up for each website. Then you need to have one setup for sportify too.

If you have all your sites for example in /var/www/ like this:
/var/www/site1
/var/www/site2
/var/www/sportify

Then you need to have the Sportify virtual host section's document root point to: /var/www/sportify/web

@carlos2727
Copy link
Author

@aminvakil thanks, I copied the info and added the correct path to the sportify folder. Still nothing, I get a blank page..

@cmihaylov I created the virtual server for sportify [/wc/web/] but I'm still getting a blank page
423426457567

When trying to go to .../wc/web/ it's showing a blank page and the console is not showing any errors, it's an empty DOM.

I'm still able to go to /web/config.php
/web/app_dev.php is returning "You are not allowed to access this file. Check app_dev.php for more information."

@aminvakil
Copy link
Contributor

aminvakil commented Jun 15, 2018

Check /var/log/apache2/access.log && /var/log/apache2/error.log.
Maybe you could find something useful.
Also try this command and browse localhost/app_dev.php
ssh -D 1080 <your_user>@<your_ip>
It will create a socks5 tunnel in your 1080 port and you can browse through your server if you change your browser proxy settings.
Socks5: Host: localhost Port: 1080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants