How to use Apache/PHP Docker?


Recommended Posts

Hey, there...

 

so ive installed PHP with Apache (https://hub.docker.com/_/php/) via php:apache-stretch

 

But my brain does not understand how to use it. Ive exported the conf files to my array:

 

/var/log/apache2 -> /mnt/user/appdata/apache2/log

 

(same for apache conf, and php conf)

 

Thats my start cmd

Quote

/usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='php' --net='bridge' --log-opt max-size='10m' --log-opt max-file='3' -e TZ="Europe/Berlin" -e HOST_OS="Unraid" -p '123:80/tcp' -v '/mnt/user/appdata/apache/web':'/var/www/html':'rw' -v '/mnt/user/appdata/apache/php':'/usr/local/php':'rw' -v '/mnt/user/appdata/apache/apache2':'/etc/apache2':'rw' -v '/mnt/user/appdata/apache/logs':'/var/log/apache2':'rw' --restart=unless-stopped -c=128 'php:apache-stretch' 

 

 

Sadly this doesnt work out of the box, so i had to manually copy the files outside and then link it outside. (u know what i mean? :D) If i just link it, the fodlers are empty and the docker cant start up...

 

1.) Anyway, my biggest problem is: how to enable extentions (like mysql and htaccess)

 

If i ssh into the container and issue "what ever the command was" it installs the extention and it works till next restart, but how to archive this permanent?

 

2.) What is the correct way to link conf and log files to outside? Why does docker wont install the programm in the linked directory on startup? (thats how it should work if i understand it correct)

 

 

Edited by nuhll
Link to comment
4 hours ago, nuhll said:

1.) Anyway, my biggest problem is: how to enable extentions (like mysql and htaccess)

 

4 hours ago, nuhll said:

If i ssh into the container and issue "what ever the command was" it installs the extention and it works till next restart, but how to archive this permanent?

The dockerHub page shows you how to install more extensions by changing the dockerfile.  Ultimately this means that you'll be building the image locally via docker build command.

Link to comment
On 4/20/2019 at 5:11 PM, Squid said:

No.  You have to clone the GitHub repo for the container.  Then you pull it down onto your server.  Then you edit the dockerfile locally.  Then you issue an appropriate docker build command on the server.

You mean i can use the "docker" commands via ssh and it appears then in the browser?

 

But i still dont know what you mean by clone the github repo, wouldnt that mean i dont get new updates? For the container?

 

Is that what you mean? https://docs.docker.com/get-started/part2/

 

And i can issue these commands via ssh on unraid (i obv dont need to install docker) and unraid will itself figure out to display it in the frontend?

 

I dont want everything "fresh to eat" ill do my research on my own, i just need to know where to start.


Overall, if i make this much work, i could also upload it to our appstore, where i can find information on doin so?

Edited by nuhll
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.