Tag Archives: ubuntu

Quick Ubuntu 16 Setup with java8, mysql 5.7, tomcat7

sudo apt-get update

# get latest java, which is java8 at time of writing
sudo apt-get install default-jdk

# get latest mysql, which is mysql5.7 at time of writing
sudo apt-get install mysql-server

# get tomcat7
sudo apt-get install tomcat7
Advertisements
Tagged , , ,

Ubuntu/Debian’s apt-get commands

This is a useful list of commands for managing packages on Ubuntu or Debian.

This will show you what versions of a package are available for your system.

apt-cache showpkg <package>

This will install the latest version of the package.

apt-get install <package>

This will install a specific version of the package. The version can be obtained from the apt-cache command above.

apt-get install <package>=<version>

This will show you what version you have installed.

apt-show-versions <package>

This will remove the package.

apt-get --purge remove <package>
Tagged , ,

Adding new user to vsftpd (ftp in ubuntu)

Step 1)
Add a user with a home directory to the ubuntu server.
Here’s a HowTo.

And in case the content disappears, here it is:

sudo useradd -d /home/newftpuser -m newftpuser
sudo passwd newftpuser

Step 2)
Configure your vsftpd server.
Here’s a HowTo.

Here are the core steps for those too lazy (like me) to click the link above or want to hear my explanation for what each command does.

Edit /etc/vsftpd.conf and add/uncomment the following line:

chroot_list_enable=YES

You only have to do this the first time obviously.
This will allow all system users to browse around the file system except those listed in the /etc/vsftpd.chroot_list (which we’ll modify next).

Create or edit the /etc/vsftpd.chroot_list and add the user:

newftpuser

This will restrict this user’s ftp access to just their home folder at /home/newftpuser.

Step 3)
Restart the vsftpd service.

service vsftpd restart

Make sure all your ftp clients are disconnected from the ftp server or else the service waits till those users are done.

Tagged , ,

Reasons why I hate Ubuntu: configuring apache

On the Mac, adding the mod_proxy module was as simple as adding a single line to a configuration file. On ubuntu, it’s a lot less obvious.

Here’s what you need to do
1) Install the modules:

sudo apt-get install libapache2-mod-proxy-html
apt-get install libxml2-dev

If you get an error with apt-get install, you may need to update the indexes:

apt-get update

Some people say you can just softlink the available modules to the enabled modules, which are located at /etc/apache2/mods-available and /etc/apache2/mods-enabled, respectively.
But I could not find the required modules under the mods-available and I wasn’t sure what other submodules were needed.
2) Supposedly having the softlinks in mods-enabled should load it without having to add “LoadModule” commands into the apache2 configuration, but that is not the case.
For me, the following 3 lines were needed:

LoadModule  proxy_http_module    /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule  headers_module       /usr/lib/apache2/modules/mod_headers.so
LoadFile    /usr/lib/libxml2.so

In addition, you need to set the reverse proxy urls

ProxyPass /pass/ http://localhost:8080/

Where do you put this? Well, there are several places. Here’s a full list.
I decided to put it in /etc/apache2/httpd.conf

Tagged ,