HowTo Laravel in ISPConfig 3.2.10p1

Discussion in 'HOWTO-Related Questions' started by niemand-glaumy, Jun 30, 2023.

  1. Gud deh!
    I found this tutorial: https://www.howtoforge.com/tutorial/install-laravel-on-ubuntu-for-apache/
    which isn't perfect for my case but it works so far.
    When creating a new project with composer, I ran into an issue (".cache is not writeable" - because it is trying to write in the wrong place.):
    Little background, in case you're wondering: Once again, I setup a VM for local development. I made it so fantasydomain.dlt would work, websites are displayed. Certs are selfsigned and firefox was bitchin but I shut it up. This system is for my personal development only, not for public eye.

    I tried different approaches, like setting the owner of /home/nmnd/composer-setup.php as well as /usr/local/bin/composer to nmnd:nmnd.
    I created /var/www/clients/client1/web2/web/.cache (which is a sibling of laravelapp and .config) and set it's owner to web2:client1 - BUT! that's not the file composer tries to install .cache into.
    I also tried to CREATE /var/www/clients/client1/web2/.cache/ but I do not have any permissions to do so, even as root. And if I could create it, I couldn't change its ownership.

    So TL;DR: So the easiest workaround: How exactly do I change composers .cache installation location? (That would be the most practical solution, I guess.)



    And then watch me next week, when I'm tryna install sass. :p
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I would try installing that laravel in web/something/folder/ if not in web/something/ and see whether that .cache might actually work?
     
    niemand-glaumy likes this.
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    I agree that using a subfolder of the web folder for Laravel is probably a better option and then set this new subfolder as doc root in Apache/Nginx directives field.
     
    niemand-glaumy likes this.
  4. So do I, that's why I got /var/www/clients/client1/web2/web/laravelapp - and it works. It's just the .cache error message that bothers me - as well as it's annoying as hell when I'm trying to work with the directories in visual studio code because not only do I not have any permissions for it, I have to click "Save as admin" and put in my pwd everytime I press ctrl+s.

    I worked around the last problem by changing the owning user of web/laravelapp/ to "nmnd".

    It feels weird and very restricting to me as a nonlinuxnative that root can't mkdir or anything (like chown) in /var/www/clients/client1/*
    Luckily this is not a public system where security is an issue and I can noob about with it.



    UPDATE
    SOLUTION maybe HERE: https://forum.howtoforge.com/thread...-www-clients-clientx-webxx.61192/#post-295212

    UPDATE2: Removing the checkmark didn't work. :D

    UPDATE3: Okay, using
    Code:
    chattr -i web
    seems to have done the trick. Dunno why the unchecking didn't.
     
    Last edited: Jul 1, 2023
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    The checkbox works fine, it is about new websites only and does not alter existing ones.
     
    ahrasis and niemand-glaumy like this.
  6. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    From my side I see you are using server root to install laravel and not that website shell user where I think the best bet is to run laravel via the later, if possible like may be after adding composer to jailkit.
    The following search results about laravel and ISPConfig may be useful or informative:
    https://forum.howtoforge.com/search/1431686/?q=laravel&o=date&c[node]=27
    https://www.google.com/search?client=firefox-b-d&q=how+to+install+laravel+in+ispconfig
     

Share This Page