Friday, May 26, 2017

how to add swap on EC2


To add this extra space to your instance you type
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo chmod 600 /var/swap.1
sudo /sbin/swapon /var/swap.1

add this line to /etc/fstab:
swap        /var/swap.1 swap    defaults        0   0

Wednesday, May 10, 2017

How to change MySQL table names in Linux server to be case insensitive?

Edit the mysql configuration file
nano /etc/mysql/my.cnf
or any other my.cnf file which is used to configure your mysql.
Under 
[mysqld]
add the line 
lower_case_table_names=1
Run 
sudo service mysqld restart
You might want to reimport your windows database into your linux database. Preferably from scratch, with add table and insert statements.
It's good!

http://stackoverflow.com/questions/11165944/how-to-change-mysql-table-names-in-linux-server-to-be-case-insensitive

Tuesday, May 9, 2017

Change port 8080 to 80 in Tomcat

As previous answers didn't work well (it was good, but not enough) for me on a 14.04 Ubuntu Server, I mention these recommendations (this is a quote). 
Edit: note that as @jason-faust mentioned it in the comments, on 14.04, the authbind package that ships with it does support IPv6 now, so the prefer IPv4 thing isn't needed any longer
1) Install authbind
2) Make port 80 available to authbind (you need to be root):

  touch /etc/authbind/byport/80
  chmod 500 /etc/authbind/byport/80
  chown tomcat7 /etc/authbind/byport/80

3) Make IPv4 the default (authbind does not currently support IPv6).
   To do so, create the file TOMCAT/bin/setenv.sh with the following content: 

   CATALINA_OPTS="-Djava.net.preferIPv4Stack=true"

4) Change /usr/share/tomcat7/bin/startup.sh

  exec authbind --deep "$PRGDIR"/"$EXECUTABLE" start "$@"
  # OLD: exec "$PRGDIR"/"$EXECUTABLE" start "$@"
If you already got a setenv.sh file in /usr/share/tomcat7/bin with CATALINA_OPTS, you have to use :
export CATALINA_OPTS="$CATALINA_OPTS -Djava.net.preferIPv4Stack=true"
Now you can change the port to 80 as told in other answers.
If you don't find setenv.sh try to create it.

http://stackoverflow.com/questions/4756039/how-to-change-the-port-of-tomcat-from-8080-to-80