my personal web pages with blog
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
composer.json web site

It's PHP site based on Nette web framework. Development is based on docker in VirtualBox guest Ubuntu server machine.


PHP 5.6 or higher, Apache, Docker

Docker usage

Docker is used for easy cross machine and operating system development. Docker setup is in the docker directory. There are docker images and one bash script - for easy managing containers. There are two containers one for the web, one for the database administration. There are Dockerfiles for these containers. For help use --help. Common operations

# go to docker directory
$ cd docker

# builds the image for web container
$ buildImage web 

# builds the image for database administration container
$ buildImage dbm

# just call the docker-compose for our project, prints the
# all docker-compose help
$ compose

# stars the web container, one or all project containers
$ compose up -d
$ compose up -d

# stop all containers
$ compose stop

# call the composer install inside web container
$ exec composer install

#  import dump into database
$ exec db bash -c "mysql -u root -plocaldb mirin < /usr/src/dbumps/mirin.sql"

As you can see, compose sub command simple calls the anything with docker-compose

Containers support development for inside native linux host, and inside VirtualBox linux guest virtual machine inside Windows. Virtual machine has the shared folders and host only network as the connection with the Windows host. See one of my Gist - - for the setup of the VirtualBox guest machine.

Webs are accessible in the Windows on the guest box VM, it's mostly, or another IP which is setup as host only network interface for guest VM. It's necessary to add the www.mirin.dkl into the Windows hosts file because container web is the name based virtual host. Database administration is directly on the url

Settings for temp, log directory

Use setgid bit and appropriate group for the write access for developer and web server.

$ cd appdir
$ find temp -type d | xargs chmod -c 2775
# with sudo e.g
$ find temp -type d | xargs sudo chmod -c 2775

$ find temp -type f | xargs chmod -c 664
$ chown -Rc www-data:developers temp 

# maybe .htaccess can be writtable for owner only,
# but maybe for developers also, it's up to you
$ find temp -name ".htaccess" | xargs chmod -c 644

$ chmod -c 2775 log
$ chmod -Rc 664 log/*
$ chown -Rc www-data:developers log 

It's necessary to call these under root. When new directory under temp is created, it's necessary create it with the permissions 2775 for correct setgid bit usage.

Settings for rotate logs

App is installed e.g. in /var/www/html/, so add this one into /etc/logrotate.d/

/var/www/*.log /var/www/*.html {
    rotate 7

Then check the /var/lib/logrotate/status