administration etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
administration etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

25 Ağustos 2013 Pazar

How to Bind Port 80 to Tomcat 7 in Ubuntu



Default tomcat installation uses 8080 port. This is not preferred way when you present your web application over a top-level domain. I needed this information for my new sites gamenism.com/game and onlineuml.net/modeler. Below I am describing how to bind port 80 to Tomcat 7.
  • Backup /var/lib/tomcat7/conf/server.xml
  • Open /var/lib/tomcat7/conf/server.xml for editing. Find the part beginning with "<Connector"
    As highlighted below, change the value of port attribute to 80.

    <Connector port="80" protocol="HTTP/1.1"    connectionTimeout="20000"   
        URIEncoding="UTF-8"
       
        redirectPort="8443" />
  • Backup /etc/default/tomcat7 file
  • Open /etc/default/tomcat7 file for editing. 
    • Find the line containing "AUTHBIND" property. This line should be commented. Uncomment it.
    • Set AUTHBIND property to YES. This is required to bind a port to a process which is less than 1023.

      AUTHBIND=yes
  • Restart tomcat 7

    sudo /etc/init.t/tomcat7 restart

8 Ekim 2010 Cuma

Solaris: How To Download File In Command Prompt

wget command is used to download files in unix based operating systems. But in Solaris the command does not seem to exist:

# wget
wget: not found

Actually it exists in the file system. But it just isn't added into PATH by default. The location of command is /usr/sfw/bin/wget. Following is a usage example of wget in Solaris.

# /usr/sfw/bin/wget google.com
--2010-10-08 11:15:20--  http://google.com/
Resolving google.com... 74.125.87.99, 74.125.87.104
Connecting to google.com|74.125.87.99|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.google.com/ [following]
--2010-10-08 11:15:20--  http://www.google.com/
Resolving www.google.com... 74.125.87.104, 74.125.87.99
Reusing existing connection to google.com:80.
HTTP request sent, awaiting response... 302 Found
Location: http://www.google.com.tr/ [following]
--2010-10-08 11:15:20--  http://www.google.com.tr/
Resolving www.google.com.tr... 74.125.87.104, 74.125.87.99
Reusing existing connection to google.com:80.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `index.html.2'

    [ <=>                                                                                       ] 9,005       --.-K/s   in 0.01s  

2010-10-08 11:15:20 (685 KB/s) - `index.html.2' saved [9005]

6 Nisan 2009 Pazartesi

Oracle XE'de HTTP Portu Nasıl Değiştirilir?

Oracle XE, standart olarak 8080 no'lu HTTP portu olarak kullanır. Bu portu JBoss ve Tomcat de HTTP portu olarak kullandığı için, Oracle ile beraber bir application server çalıştırmak için, ya application server'in ya da Oracle'in HTTP portunun değiştirilmesi gerekiyor.

Oracle'de bu portu değiştirmek icin dbms_xdb.sethttpport() fonksiyonunu kullanabilirsiniz. Database'e system kullanıcısıyla giriş yaptıktan sonra aşağıdaki şekilde çalıştırabilirsiniz:

EXEC dbms_xdb.sethttpport(8090);

28 Temmuz 2008 Pazartesi

JBoss server'a IP numarası ile erişim

Lokal makinemizde çalışan jboss'a http://localhost:8080 adresiyle erişebiliyoruz. Ama http://127.0.0.1:8080 adresiyle denediğimizde, şeklinde erişemeyiz. Bununla beraber uzaktaki bir istemci de ip numaramızı bilmesine rağmen erişim problemi yaşayacaktır. IP numarası ile erişimi aktive etmek için Jboss'u "-b" parametresiyle başlatmamız gerekmektedir. Bu durumda kullanacağımız komut aşağıdaki gibi olacaktır.

> run.bat -b 0.0.0.0

27 Temmuz 2008 Pazar

JBoss'u baska bir domain ile başlatmak

Standart Jboss kurulumu "default" adli server instance'ı başlatmaktadır. Başka bir server instance'i başlatmak için "-c" parametresini kullanmalıyız. Örneğin standart kurulumda gelen, "minimal" adli server'ı başlatmak için aşağıdaki komutu kullanmalıyız:

> run.bat -c minimal

25 Nisan 2008 Cuma

How To Export Query Results In Mysql

Use "INTO OUTFILE" directive in your queries to export data from mysql into a text file.

mysql> select * from videos order by artist INTO OUTFILE "c:\videos.csv"
Query OK, 3269 rows affected (0.05 sec)


Use "FIELDS TERMINATED BY" directive to determine delimiter between fields.

mysql> select * from videos order by artist INTO OUTFILE "c:\videos.csv" FIELDS TERMINATED BY "|";
Query OK, 3269 rows affected (0.06 sec)


If you do not specify absolute path in "INTO OUTFILE" directive, the file will be recorded in current database's path. For example, assume that mysql is installed in "D:\dev\mysql" and the current database is "video_db"; then the path of videos.csv would be "D:\dev\mysql\data\video_db".

24 Nisan 2008 Perşembe

How To Change MySql Root Password

In this example, I am going to change mysql root account's password from 1234 to 123456 using SQL. The queries are so self-explanatory. So, there is no need to describe them.

D:\dev\xampp\mysql\bin>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.51a Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql;
Database changed
mysql> update user set password=PASSWORD("123456") where User="root";
Query OK, 2 rows affected (0.03 sec)
Rows matched: 2 Changed: 2 Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

D:\dev\xampp\mysql\bin>mysql -u root -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.51a Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

14 Nisan 2008 Pazartesi

Some Mysql-Specific Commands

Following is a list of some of mysql specific commands that I frequently use. You should be connected to mysql server through the command-line to execute the commands.

>show databases;
Display the list of databases hosted by the mysql server

>use db;
Selects the database to be working on.

>desc table;
Describes the metadata of the table;

>show tables;
Display tables of the selected database

>source test.sql;
execute an SQL script file

8 Nisan 2008 Salı

How To Kill A Process In Windows: TASKKILL

What is taskkill?

To kill a process in Windows using command-line use TASKKILL command.

If you know the name of the process use /im switch. Following command terminates Windows Media Player:

taskkill /im wmplayer.exe

If you know the process id, use /pid switch. Following command terminates the process identified by PID=1545:

taskkill /pid 1545

If you want to kill the parent process and its child processes, namely tree-kill, use /t switch. Following command terminates the process identified by PID=1545:

taskkill /t /pid 1545

If you want to force the process to be terminated, use /f switch. Following command terminates the process forcefully:

taskkill /f /pid 1545