Create virtual host on a Debian Stretch server

After a Debian 9 server (Debian GNU/Linux 9 (stretch)) was installed, a web server with virtual host capability was needed.  At the first step, creating a conf file for the virtual host and enabling it and  then restarting the apache2 service were successful. However, the next step was not straightforward.  After files were copied to the root folder of the virtual host, error messages were persistent whenever which pages were visited.

The error message like” You don’t have permission to access <page name> on this server”. It was wired because the same virtual host conf file was fine on Ubuntu servers with old Linux version.

After googling the internet, the problem was nailed down. the new version of Apache2 increases the security of virtual hosts. One more directive is needed to make it work. In the virtual host conf file, need add “Require all granted”. A working version of an virtual host conf file is the following.

<VirtualHost *:80>
ServerName 192.168.0.200

# Indexs + Directory Root.
DirectoryIndex index.html index.php
DocumentRoot {your virtual host root data folder}

<Directory />
  Options FollowSymLinks
  AllowOverride None
</Directory>

<Directory "{your virtual host root data folder}">
  Options Indexes FollowSymLinks MultiViews
  AllowOverride None
  Order allow,deny
  Allow from all
  # new directive needed in Apache 2.4.3 and beyond
  Require all granted
</Directory>

# Logfiles
ErrorLog {your virtual host root folder}/logs/error.log
CustomLog {your virtual host root folder}/logs/access.log combined

</VirtualHost>
Share

Tags: , , , ,

Ping external domain failed on Debian Stretch

After a debian stretch server was setup, pinging external domain always failed. That makes installing any packages / software impossible because it cannot access the ftp.debian.org server.

After a lengthy searching on Google, finally the problem was nailed down and solved easily. The cause of the problem is the Debian Network Manager. To solve this problem, please execute the following command line commands in a terminal.


apt-get remove --purge network-manager
nano /etc/resolv.conf

Add the following line to the resolv.conf file.

nameserver 192.168.0.1

You should change the IP address based on your wireless network accordingly.

After the change, reboot your computer to a fresh start. Then execute the following commands.


apt-get update
apt-get install <your package name>

Share

Tags: , ,

Turn on the web server service on macOS

Apache webserver is shipped with all macOS version. The newer macOS version no longer provides user interface to control the webserver. Geeks who know Linux can turn on and off the webserver easily through the command line client. The following article on Apple community provides a step by step tutorial to do this.

Setting up a local web server on macOS 10.13 “High Sierra”

After you follow the above article to turn on your webserver. You can find the all software is up to date and ready to use. The latest PHP version is 7.1.7.

Share

Tags: , , , , ,

Ubuntu 16.04 TLS Development Environment

Ubuntu 16.04 TLS is a good, stable OS. After install the Ubuntu Desktop system, a set of applications should be installed to get a nice programming environment.

1 Web development applications
A while ago I wrote an article “Web Development Tools for Ubuntu OS“. It introduced Geany for editing, Workbench for SQL, Meld for file comparison, and Google Chrome for web testing. These applications are still hold true for Ubuntu 16.04 TLS.

2. R programming environment
First, install R base. Execute the following command in a terminal window (CTL + ALT + T) to add the source url to the APT source list.

sudo echo “deb http://cran.rstudio.com/bin/linux/ubuntu xenial/” | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install r-base r-base-dev

Then, install RStudio. Use the “Ubuntu Software” to search for R Studio and install it. It is pretty straight forward.

After install R Studio, you can open it and check if it works.

3. Python programming environment

Install Spyder. Use the “Ubuntu Software” to search for “Spyder” and install it. It is pretty straight forward.

Share

Tags: , , ,

PyCharm – The Python IDE crossing multiple platforms

Here is the declaration on the PyCharm site about it.

PyCharm is a dedicated Python and Django IDE providing a wide range of essential tools for Python developers, tightly integrated together to create a convenient environment for productive Python development and Web development.

It is available for Windows, macOS, and Linux. It can be downloaded from http://www.jetbrains.com/pycharm/download/.

I just start using it. I read some good comments about it from the internet.

Share

Tags: , ,