หน้าเว็บ

แสดงบทความที่มีป้ายกำกับ ubuntu server แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ ubuntu server แสดงบทความทั้งหมด

วันพุธที่ 22 ตุลาคม พ.ศ. 2557

เขียน Service Glassfish Server บน Linux Ubuntu

        server นี้ผมได้ทำการ set GLASSFISH_HOME ไว้ใน $PATH ของ file ~/.bashrc แล้วน่ะครับ  จึงทำให้สามารถเรียก asadmin ได้เลย  โดยไม่ต้องใช้ path เต็มครับ

1. ไปที่ /etc/init.d/ ด้วยคำสั่ง
$ cd /etc/init.d/
2. สร้าง file service glassfish ด้วยคำสั่ง
$ sudo vi glassfish
3. เขียนชุดคำสั่ง
#!/bin/sh
#

# define service function
start(){
    asadmin start-domain >/dev/null  
}

stop(){
    asadmin stop-domain >/dev/null  
}

restart(){
    asadmin restart-domain >/dev/null  
}

#detect service argument
case "$1" in
    start)
        start
    ;;
    stop)
        stop
    ;;
    restart)
        restart
    ;;
*)

echo $"Usage: $0 {start|stop|restart}"
exit 1
esac

exit 0
4. สั่งงาน
$ service glassfish start
หรือ
$ /etc/init.d/glassfish start

วันจันทร์ที่ 4 สิงหาคม พ.ศ. 2557

kill port linux ubuntu

1. download command from https://raw.github.com/abdennour/miscs.sh/master/killport
$ wget https://raw.github.com/abdennour/miscs.sh/master/killport
command code
#!/bin/sh
PNUMPER=$1;
kill -9 `lsof -w -n -i tcp:$PNUMPER| awk '{print $2}'|awk 'END{print}'`;
2. run command (close port 9001)
$ sh killport 9001 
thank you : http://stackoverflow.com/questions/9346211/how-to-kill-a-process-on-a-port-on-ubuntu

วันจันทร์ที่ 18 พฤศจิกายน พ.ศ. 2556

การ disabled ipv6 linux ubuntu

1. เข้าไปแก้ไข file /etc/sysctl.conf  ในที่นี้ใช้ vi editor


2. เพิ่มคำสั่งดังต่อไปนี้ ต่อท้าย file (ซึ่งปกติแล้วจะไม่มี)  จากนั้นทำการบันทึก file

วันเสาร์ที่ 17 สิงหาคม พ.ศ. 2556

install oracle java 7 on ubuntu 12.04

หากติดตั้ง ubuntu 12.04 ใหม่ๆ แล้วระบบยังไม่มีอะไรเลย ให้ทำดังต่อไปนี้
1. install python-software-properties
...
$ sudo apt-get install python-software-properties
...
2. add repository ppa:webupd8team/java
...
$ sudo add-apt-repository ppa:webupd8team/java
...
3. update repository
...
$ sudo apt-get update
...
4. install oracle-jdk7-installer
...
$ sudo apt-get install oracle-jdk7-installer
...
5. check java version
...
$ java -version
...
6. set java home
        6.1 find java path installed
...
$ find ./ -name java
...
..
/usr/lib/jvm/java-7-oracle/bin/java
...
        6.2 install vim (for edit config java home file)
...
$ sudo apt-get install vim
...
        6.3 edit ~/.batchrc
...
$ cd ~
$ sudo apt-get install vim
$ vi .batchrc
...
        6.4 on vi put <i> for into vi insert mode and add this to end line
...
export JAVA_HOME= /usr/lib/jvm/java-7-oracle
export PATH=$PATH:$JAVA_HOME/bin
...
        6.5 save : put<Esc> for out from vi insert mode then put <:wq> for save .batchrc
7. test java
..
$ vi HelloWorld.java
..
put<i> then write code following


put<Esc> for exit from insert mode then put<:wq> for save
compile(javac) and run code(java)


วันพฤหัสบดีที่ 26 เมษายน พ.ศ. 2555

ทำ (Mod-Security2) Hardening ให้กับ (Apache) Web Server บน Ubuntu 11.10 Server


        ModeSecurity คือ Software Open Source ตัวหนึ่งที่ทำหน้าที่ ในการ Detection และ Prevention Engine สำหรับ เว็บไซต์ของเราที่อยู่ฝั่ง Server ที่มีประสิทธิภาพในการป้องกันการโจมตี ซึ่งเป็นส่วนหนึ่งของโมดูล Apache

      1. เปิด Terminal ขึ้นมา  ด้วยการกด Ctrl + Alt + t

การติดตั้ง Mail Server (iRedMail) ให้กับ Ubuntu 11.10 Server

1. เปิด Terminal ขึ้นมา  ด้วยการกด Ctrl + Alt + t


      2. ดู IP ของ Server  โดยใช้คำสั่งดังต่อไปนี้  $ sudo ifconfig  ดังรูป

การติดตั้ง SSL แบบ Self-Sign ให้กับ FTP Server (vsftpd) บน Ubuntu 11.10 Server

1. ใช้ SSL สร้าง Key โดยใช้คำสั่งดังต่อไปนี้
$ suso openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/vsftpd.pem -out /etc/vsftpd.pem    
ดังรูป
2. กรอกข้อมูลลงไปดังรูปต่อไปนี้

วันจันทร์ที่ 16 เมษายน พ.ศ. 2555

การติดตั้ง SSL แบบ Self-Sign ให้กับ (Apache) Web Server บน Ubuntu 11.10 Server

      1. เปิด Terminal ขึ้นมาด้วยการกด Ctrl + Alt + t ดังรูป



      2. สร้าง Directory สำหรับติดตั้ง Key โดยใช้คำสั่ง

วันอาทิตย์ที่ 15 เมษายน พ.ศ. 2555

การติดตั้งและ Remote เข้าใช้งาน Ubuntu 11.10 Server ด้วย SSH

1. เปิด Terminal ขึ้นมา  ด้วยการกด  Ctrl + Alt +t


        2. ให้ทำการ Update และ Upgrade Server ให้มีความเป็นปัจจุบันก่อน 

การติดตั้งและแชร์ไฟล์ผ่าน SAMBA ให้กับ Ubutntu 11.10 Server

1. เปิด Terminal ขึ้นมา  ด้วยการกด Ctrl + Alt + t


      2. ให้ทำการ Update และ Upgrade Server ให้มีความเป็นปัจจุบันก่อน

วันพฤหัสบดีที่ 12 เมษายน พ.ศ. 2555

การติดตั้ง FTP Server (vsftpd) ให้กับ Ubuntu 11.10 Server

1. เปิด Terminal ขึ้นมา  ด้วยการกด Ctrl + Alt + t


        2. ให้ทำการ Update และ Upgrade Server ให้มีความเป็นปัจจุบันก่อน 

วันพุธที่ 11 เมษายน พ.ศ. 2555

การติดตั้ง (Apache) Web Server ให้กับ Ubuntu 11.10 Server

1. เปิด Terminal ขึ้นมา  ด้วยการกด Ctrl + Alt + t


      2. ให้ทำการ Update และ Upgrade Server ให้มีความเป็นปัจจุบันก่อน 

วันอังคารที่ 10 เมษายน พ.ศ. 2555

การติดตั้ง GUI ให้กับ Ubuntu 11.10 Server

            โดยปกติแล้ว  เวลาที่เราทำการติดตั้ง Ubuntu Server ใหม่ๆ มันจะไม่มี GUI  มาให้  ให้เราทำการติดตั้งเองดังต่อไปนี้
1. ให้ทำการ Update และ Upgrade Server ให้มีความเป็นปัจจุบันก่อน 
  • การ Update จะใช้คำสั่ง  $ sudo apt-get update  จากนั้นใส่รหัสผ่านลงไป
  • การ Upgrade จะใช้คำสั่ง $ sudo apt-get upgrade จากนั้นใส่รหัสผ่านลงไป


ผลจากการ Update Upgrade เสร็จ

การติดตั้ง Ubuntu 11.10 Server 32-bit ใน VMware

  1. เข้าใช้งาน VMware ด้วยการคลิ๊กที่ Icon โปรแกรม VMware WorkStation ดังรูป


  2. เมื่อเข้าสู่ VMware ให้คลิ๊กเลือกที่ Menu Bar  ของโปรแกรม เลือก File->New Virtual Machine… หรือคลิ๊กที่ Create New Virtual Machine ในหน้า Home ดังรูป

วันพฤหัสบดีที่ 5 มกราคม พ.ศ. 2555

การติดตั้ง Fonts ภาษาไทยให้กับ Ubuntu 11.10 Server

ปัญหาที่เจอคือ  Browser ไม่รองรับภาษาไทย  คือ  อ่านไม่รู้เรื่องดังรูป


การแก้ปัญหา

วันพุธที่ 4 มกราคม พ.ศ. 2555

แก้ sources list ให้ชี้มาที่ประเทศไทย (unbuntu server 11.10)

sources.list  จะเก็บอยู่ที่  /etc/apt/

แก้ข้างในให้เป็นดังนี้(ลบทั้งหมดออก  แล้วก๊อปไปวางใหม่เลย)

# deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Alpha amd64 (20110827)]/ oneiric main restricted
# deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Alpha amd64 (20110827)]/ dists/oneiric/main/binary-i386/

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://th.archive.ubuntu.com/ubuntu/ oneiric main restricted
deb-src http://th.archive.ubuntu.com/ubuntu/ oneiric main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://th.archive.ubuntu.com/ubuntu/ oneiric-updates main restricted
deb-src http://th.archive.ubuntu.com/ubuntu/ oneiric-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://th.archive.ubuntu.com/ubuntu/ oneiric universe
deb-src http://th.archive.ubuntu.com/ubuntu/ oneiric universe
deb http://th.archive.ubuntu.com/ubuntu/ oneiric-updates universe
deb-src http://th.archive.ubuntu.com/ubuntu/ oneiric-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://th.archive.ubuntu.com/ubuntu/ oneiric multiverse
deb-src http://th.archive.ubuntu.com/ubuntu/ oneiric multiverse
deb http://th.archive.ubuntu.com/ubuntu/ oneiric-updates multiverse
deb-src http://th.archive.ubuntu.com/ubuntu/ oneiric-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://th.archive.ubuntu.com/ubuntu/ oneiric-backports main restricted universe multiverse
deb-src http://th.archive.ubuntu.com/ubuntu/ oneiric-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu oneiric-security main restricted
deb-src http://security.ubuntu.com/ubuntu oneiric-security main restricted
deb http://security.ubuntu.com/ubuntu oneiric-security universe
deb-src http://security.ubuntu.com/ubuntu oneiric-security universe
deb http://security.ubuntu.com/ubuntu oneiric-security multiverse
deb-src http://security.ubuntu.com/ubuntu oneiric-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu oneiric partner
# deb-src http://archive.canonical.com/ubuntu oneiric partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu oneiric main
deb-src http://extras.ubuntu.com/ubuntu oneiric main

  
ผมยกเครดิตให้พี่หมอครับ  ^^

set up apache virtualhosts on linux ubuntu

        When you installed packege apache2, php5, php5-mysql, mysql-server, mysql-client, phymyadmin successful you can do follow

step 1. Firstly you must create virtualhost directory at other that you want.
such as /home/redcrow/workspace/atstand

step 2. Go to /etc/  then edit file name's hosts 
(add ip address and hostname that you want) such as
i'am add ip address 127.0.0.1(reference own computer) and host name's atstand.dear.dev(URL website)


วันอาทิตย์ที่ 25 ธันวาคม พ.ศ. 2554