Skip to content

Instantly share code, notes, and snippets.

@jasperf
Last active March 26, 2023 13:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jasperf/d0cbc7b4506d72fb1fe9 to your computer and use it in GitHub Desktop.
Save jasperf/d0cbc7b4506d72fb1fe9 to your computer and use it in GitHub Desktop.
Ubuntu Server Setup History installing Apache, mysql, PHP, git, SSH, WordPress using Backup buddy backup #lamp #ubuntu #wordpress

Ubuntu Server Setup

Installing LAMP Stack

Update All sudo apt-get update

install apache and mysql

```sudo apt-get install apache2```

sudo apt-get install apache2 apache2-utils

sudo apt-get install mysql-server php5-mysql

sudo mysql_secure_installation

install php and some modules

```sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt```

sudo nano /etc/apache2/mods-enabled/dir.conf

cat /etc/apache2/mods-enabled/dir.conf

sudo service apache2 restart

add xdebug
```sudo apt-get install php5-xdebug```

sudo find / -name 'opcache.so'

sudo service apache2 restart

Check if PHP is running well
```sudo nano /var/www/html/info.php```

Install git

```sudo apt-get install git-core```
Configure username and email using these commands:
```git config --global user.name "me"```

git config --global user.email jasper@me.com

Install Open SSH Server to use ssh to access the server

```sudo apt-get install openssh-server```

upload files from local server

```scp backup-domain_com-2014_08_29-full-xmx68o1np8.zip me@ubuntu.ubu:/var/www/html/```

scp importbuddy.php me@ubuntu.ubu:/var/www/html/

Add user configured at the beginning to www-data group

```sudo adduser me www-data```
change /var/www/html to you:www-data group. Perhaps it should be owner www-data as well..
```sudo chown username:www-data /var/www -R ```
make sure newly added files get the same permissions
```sudo chmod g+w /var/www -R ```

Install vsftpd Daemon to access server using FTP

```sudo apt-get update```

sudo apt-get install vsftpd

sudo reboot

cd /var/www/html/

Using Backup Buddy migration file to install WordPress clone

```chown me:www-data backup-imagewize_com-2014_08_29-full-xmx68o1np8.zip ```

chown me:www-data importbuddy.php

Make www group www-data and owned by your user as well.Perhaps owner should be root though..

```sudo chown me:www-data -R /var/www/```

As access to user me is not allowed with 755 changed to 775. Server not shared and php mod used so OK

```chmod 775 html/``` ```ls -la```

reCaptcha and Captcha need GD

```sudo apt-get install php5-gd```

sudo service apache2 restart

WordPress permalinks need Mod Rewrite

```sudo a2enmod rewrite```

sudo service apache2 restart

Add Allow Overwrite All: AllowOverride All

``` Options FollowSymLinks AllowOverride All Require all denied

<Directory /usr/share> AllowOverride None Require all granted

<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted

<Directory /srv/> Options Indexes FollowSymLinks AllowOverride None Require all granted```

sudo nano /etc/apache2/apache2.conf

sudo service apache2 restart

cd /etc/apache2/mods-available

Add Mod Headers as WordPress had issues loading Dashboard without it..

```sudo a2enmod headers```

sudo service apache2 restart

Add vhost in Ubuntu

```sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/img.ubu.conf```

sudo nano /etc/apache2/sites-available/img.ubu.conf

sudo a2ensite img.ubu.conf

sudo service apache2 reload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment