This is a simple/short guide to execute common commands when using PHP, Apache in an Ubuntu Server
Command
id
Output
uid=1002(cfv) gid=1002(cfv) groups=1002(cfv),27(sudo)
Command
ls -la
Example
ls -la /var/www
Command
sudo chown -R $USER:$USER /var/www/html
Example
sudo chown username: myfolder
Example
sudo chown -R $USER:www-data storage
Example
sudo chown -R $USER:www-data bootstrap/cache
Command
chmod -R 775
Example
chmod -R 775 storage
Example
chmod -R 775 bootstrap/cache
The number in the permissions depends on what level of access you want to give to your users.
Command
sudo vim .bashrc
Usually you can add custom commands to your terminal here, above you will find some use cases.
Command
alias cdo='cd /var/www/html/'
cdo
will be the command you tipe in console after adding the alias.
Command
alias gitUE="git config user.email '[email protected]'; git config user.name 'My Git Name'"
This is useful too to remember how to set them up in a fresh dev environment.
Command
alias phpmyadminDisable="sudo a2disconf phpmyadmin.conf; sudo service apache2 restart"
Command
alias phpmyadminEnable="sudo a2enconf phpmyadmin.conf; sudo service apache2 restart"
Command
ln -s /opt/foo /usr/bin/bar
Command
ln -s /opt/foo file_name
- Important Paths of Apache
- Important Paths of Apache
- How to install a LAMP server
If you want to contribute or correct some of the content in this list please feel free to do it in an always friendly and free way.