Question

Configuration an existed file www.site1.com.conf

Posted January 22, 2020 401 views
ApachePHP Frameworks

I am writting this message that I need you help about apache httpd.

Before all, I work on Linux RedHat Centos , I had :

  • PHP 7.3
  • APACHE httpd 2.4
  • Symfony 4

I have many names domaines, www.site1.com, www.site2.com ..etc and they all configurate very well and they works.

I have an existed project written by php in www.website1.com, I changed and transformed same project from php to symfony. So what I did ?

  • I pute environement symfony prod and I did bin/console cache:clear =>it’s ok
  • I modified file www.site1.com.conf (in directory sites-availabes), the only change is the path :
  1. Before path was like: DocumentRoot /var/www/www.site1.com
  2. Now : DocumentRoot /var/www/www.site1.com/public and I added also
 <Directory /var/www/www.site1.com/public>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order allow,deny
        allow from all

        Require all granted

        <IfModule mod_rewrite.c>
            Options -MultiViews
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*)$ index.php [QSA,L]
        </IfModule>
   </Directory>

Then I saved the file and restart server httpd

So I go to browser web to check the website www.site1.com and I get an empty page and answer is “ERREMPTYRESPONSE”
PLZ, Do you have any idea to resolve this problem ?
Thank you for reading.
Best regards

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Do you see any errors in your Apache error log? Also it might be the permissions of the /var/www/www.site1.com/public you need to make sure that the httpd user has access to that folder.

Have you tried running a config test as well:

apachectl -t
Submit an Answer