• Good tutorial but I had a few problems with this. I created a droplet in Vultr.com with Centos7, and followed these instructions to the letter, since I dont have much experience with this. I tried it on another vendor's VPS with the default Centos7 image and same problem. I had the following issues: 1) Composer install went ok up to the line "composer install laravel/laravel testapp", which didn’t work, instead I had to use "composer create-project laravel/laravel testapp" . 2) The lines "chown -R apache:root storage/ " and "chown -R apache:root bootstrap/cache" gave errors like "chown: cannot access ‘storage/’: No such file or directory", looks like we were supposed to advance into the testapp folder for this to work 3) The 'semanage' lines gave errors like "-bash: semanage: command not found" until I installed this "yum install policycoreutils-python" 4) I tried the semanage lines again and this time got different errors: "ValueError: SELinux policy is not managed or store cannot be accessed.". I dont know what this means, both lines gave the same error. But I ignored them and pressed on and I seemed to get the right result in the browser. I hope they were not important....

    Thanks for the tutorial, its the only one I have been 'successful' with so far; I'd like to know what target you installed on such that you avoided getting all these errors though.

  • Also after completing installation and rebooting the VPS, the Laravel welcome page at myipaddress/index.php no longer came up, I just got "This site can’t be reached. [myipaddress] refused to connect."

  • Hello Augustus - thank you very much for the helpful feedback. I've made some adjustments to the tutorial to address some of the items you pointed out.

    For issue #1, I still need to double-check the issue you reported with the composer syntax. When putting this together, I did run into a few different issues with Composer but did get it working eventually.

    For issue #2, I updated the command in the tutorial to include the full path.

    For issue #3, I added text regarding policycoreutils-python. This package is included by default with the public CentOS 7 image that ProfitBricks supplies.

    For issue #4, I'm not sure what happened here, but it seems like the system(s) you were working on may not have had SELinux installed or enabled. You can verify by running sudo sestatus. I added some additional text about how to do that to the tutorial.

    Regarding your second comment, this was an oversight on my part. I had forgotten to provide the systemctl enable commands so that the services would start if the server was rebooted. As now noted in the tutorial, you can run sudo systemctl enable nginx and sudo systemctl enable php-fpm and that should take care of that issue.

  • Thanks a lot for the replies, I (we all) appreciate the support!

    With regard to issue #4, SELinux reported as being Disabled, with sestatus. I entered "rpm -qa | grep selinux" and got the following:

    libselinux-2.5-6.el7.x86_64

    libselinux-utils-2.5-6.el7.x86_64

    libselinux-python-2.5-6.el7.x86_64

    So then according to this page "https://www.digitalocean.com/community/tutorials/an-introduction-to-selinux-on-centos-7-part-1-basic-concepts" I installed a few more things:

    yum install policycoreutils policycoreutils-python selinux-policy selinux-policy-targeted libselinux-utils setroubleshoot-server setools setools-console mcstrans

    setenforce 1

    sudo systemctl restart nginx

    And now after a full reboot sestatus shows Enforcing and "rpm -qa | grep selinux" gives:

    libselinux-2.5-11.el7.x86_64

    selinux-policy-3.13.1-166.el7_4.5.noarch

    selinux-policy-targeted-3.13.1-166.el7_4.5.noarch

    libselinux-python-2.5-11.el7.x86_64

    libselinux-utils-2.5-11.el7.x86_64

    Now the semanage lines are accepted without issues. Thanks very much again!

  • Nice work - it sounds like you were able to SELinux running on the server you were testing with.

    I had a chance to verify the composer syntax, and have updated the tutorial to have the correct syntax of:

    sudo composer create-project laravel/laravel testapp
    

    It is possible to use composer require laravel/laravel and composer install - however that won't leave you with the same setup the rest of the tutorial is expecting.

  • I prefer to use Debian over CentOS. Debian has great community and timely patches. I have hosted my Laravel app on a Debian based server using the Cloudways Laravel hosting (https://www.cloudways.com/en/laravel-hosting.php ) platform and I have seen slight increase in performance when I moved from CentOS. This could be due to some other factor, but who knows.

  • Very good tutorial , and nice worked.

  • ¡Muchas gracias! Funciona. Thank you very much! works.

  • Hello,

    I am at the step getting to test the PHP file and am receiving a 500 error.

    The only thing the log shows is

    2018/05/10 09:32:47 [alert] 15552#15552: *15 open socket #11 left in connection 3

    2018/05/10 09:32:47 [alert] 15552#15552: aborting

    Not sure whats going on. I copied and pasted the entire block starting with location and added it just before the closing } for the server {} config in the .conf file. restarted everything and just get this error.

  • I ended up figuring out the issue. It was something with selinux.

    Thanks!

Log In, Add a Comment