Template:Ubuntu Edgy pl/Serwery
From
Serwery
Jak zainstalować serwer LAMP (Linux, Apache, MySQL, PHP)
Serwer antywirusowy
Jak zainstalować ClamAV (serwer antywirusowy)
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
sudo apt-get install clamav
Jak ręcznie zaktualizować bazę wirusów
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak zainstalować ClamAV ( serwer antywirusowy)
sudo freshclam
Jak ręcznie zeskanować pliki/foldery w poszukiwaniu wirusów
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak zainstalować ClamAV ( serwer antywirusowy)
sudo clamscan -r /location_of_files_or_folders
Jak automatycznie zeskanować pliki/foldery w poszukiwaniu wirusów
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak zainstalować ClamAV ( serwer antywirusowy)
- np. Automatycznie skanuje pliki/foldery w poszukiwaniu wirusów o północy, każdego dnia.
- * * * * *gwiazdki oznaczają kolejno minuty, godziny, dni, miesiące i lata
export EDITOR=gedit && sudo crontab -e
- Dodaj poniższą linię na koniec pliku
00 00 * * * sudo clamscan -r /location_of_files_or_folders
- Zapisz plik
Zobacz inne przykłady konfiguracji crontab-a
Serwer monitorowania
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
Jeżeli chcesz monitorować zużycie pamięci RAM, wykorzystanie procesora i/lub dysku itp. to powinieneś zainteresować się artykułem
"Monitor your Ubuntu Servers and Clients using Munin"
Serwer wydruku (cupsd)
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
Jak zainstalować
- Cupsd powinien się już znajdować w twoim Ubuntu, jeżeli istnieje plik "/etc/init.d/cupsys" to jest już zainstalowany. Jeżeli nie ma takiego pliku, lub chcesz zainstalować cupsd ręcznie, wykonaj
sudo apt-get install cupsys*
Jak dodać drukarkę
- Idź do System -> Administracja -> Drukarki.
- Wybierz "Nowa drukarka".
- "Powinien pojawić się kreator instalacji drukarki.
Jak drukować zdalnie z innego komputera z zainstalowanym Ubuntu
- Sprawdź, czy twoja drukarka jest poprawnie skonfigurowana.
- Włączanie współdzielenia drukarek - System -> Administracja -> Drukarki -> menu Ustawienia globalne -> Współdziel drukarki
- Adres IP serwera: 192.168.0.1
- Adres IP klienta: 192.168.0.23
- Konfiguracja serwera
sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.backup gksudo gedit /etc/cups/cupsd.conf
- znajdź
<Location /> ... Allow localhost ... </Location>
- dodaj między <Location /> a </Location >
Allow 192.168.0.23
- Zrestartuj cups
sudo /etc/init.d/cupsys restart
- Ustawienia klienta
sudo cp /etc/cups/client.conf /etc/cups/client.conf.backup gksudo gedit /etc/cups/client.conf
- dodaj do pliku poniższą linię.
ServerName 192.168.0.1
- Zrestartuj cups
sudo /etc/init.d/cupsys restart
- Wykonaj teraz "lpq", powinieneś zobaczyć coś podobnego
vitek@lightfox:~$ lpq HPLJ6P is ready no entries
Jak drukować zdalnie z innego komputera z zainstalowanym systemem Windows
- Przeczytaj #Jak zainstalować serwer Samba do udostępniania plików/folderów
- Przeczytaj #Jak drukować na zdalnym komputerze używając Samby
Serwer Samba
Jak zainstalować serwer Samba do udostępniania plików/folderów
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
sudo apt-get install samba smbfs
Jak dodać/edytować/usunąć użytkowników sieciowych
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak zainstalować serwer Samba do udostępniania plików/folderów
- Dodawanie użytkownika sieciowego
- Przeczytaj #Jak dodać/edytować/usunąć użytkowników
sudo smbpasswd -a system_username gksudo gedit /etc/samba/smbusers
- Umieść poniższą linie w nowym pliku
system_username = "network username"
- Zapisz plik
- Modyfikacja użytkownika sieciowego
sudo smbpasswd -a system_username
- Usuwanie użytkownika sieciowego
sudo smbpasswd -x system_username
Jak udostępniać folder domowy jedynie do odczytu (Autoryzacja=Tak)
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak zainstalować serwer Samba do udostępniania plików/folderów
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- Znajdź
... ; security = user ...
- Zamień na
security = user username map = /etc/samba/smbusers
- Zapisz plik
- Przeczytaj #Jak dodać/edytować/usunąć użytkowników sieciowych
sudo testparm sudo /etc/init.d/samba restart
Jak udostępniać folder domowy z uprawnieniami do zapisu oraz odczytu (Autoryzacja=Tak)
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak zainstalować serwer Samba do udostępniania plików/folderów
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- Znajdź
... ; security = user ...
- Zamień na
security = user username map = /etc/samba/smbusers
- Znajdź
... # By default, the home directories are exported read-only. Change next # parameter to 'yes' if you want to be able to write to them. writable = no ...
- Zamień na
# By default, the home directories are exported read-only. Change next # parameter to 'yes' if you want to be able to write to them. writable = yes
- Zapisz plik
- Przeczytaj #Jak dodać/edytować/usunąć użytkowników sieciowych
sudo testparm sudo /etc/init.d/samba restart
Jak dzielić foldery grup jedynie do odczytu (Autoryzacja=Tak)
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak zainstalować serwer Samba do udostępniania plików/folderów
sudo mkdir /home/group sudo chmod 777 /home/group/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- Znajdź
... ; security = user ...
- Zamień
security = user username map = /etc/samba/smbusers
- Dołącz tekst na koniec pliku
[Group] comment = Group Folder path = /home/group public = yes writable = no valid users = system_username1 system_username2 create mask = 0700 directory mask = 0700 force user = nobody force group = nogroup
- Zapisz plik
- Przeczytaj #Jak dodać/edytować/usunąć użytkowników sieciowych
sudo testparm sudo /etc/init.d/samba restart
Jak udostępnić foldery grup z uprawnieniami do zapisu/odczytu Autoryzacja=Tak)
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak zainstalować serwer Samba do udostępniania plików/folderów
sudo mkdir /home/group sudo chmod 777 /home/group/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- Znajdź
... ; security = user ...
- Zamień na
security = user username map = /etc/samba/smbusers
- Dołącz tekst na koniec plikU
[Group] comment = Group Folder path = /home/group public = yes writable = yes valid users = system_username1 system_username2 create mask = 0700 directory mask = 0700 force user = nobody force group = nogroup
- Zapisz plik
- Przeczytaj #Jak dodać/edytować/usunąć użytkowników sieciowych
sudo testparm sudo /etc/init.d/samba restart
Jak dzielić wszystkie foldery (Autoryzacja=Tak)
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak zainstalować serwer Samba do udostępniania plików/folderów
sudo mkdir /home/public sudo chmod 777 /home/public/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- Znajdź:
... ; security = user ...
- Zastąp:
security = user username map = /etc/samba/smbusers
- Na końcu pliku dopisz:
[public] comment = Public Folder path = /home/public public = yes writable = no create mask = 0777 directory mask = 0777 force user = nobody force group = nogroup
- Zapisz plik
- Przeczytaj #Jak dodać/edytować/usunąć użytkowników sieciowych
sudo testparm sudo /etc/init.d/samba restart
Jak udostępniać pliki do odczytu/zapisu (Autoryzacja=Tak)
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak zainstalować serwer Samba do udostępniania plików/folderów
sudo mkdir /home/public sudo chmod 777 /home/public/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- Znajdź
... ; security = user ...
- Zastąp
security = user username map = /etc/samba/smbusers
- Dodaj na końcu pliku
[public] comment = Public Folder path = /home/public public = yes writable = yes create mask = 0777 directory mask = 0777 force user = nobody force group = nogroup
- Zapisz plik
- Przeczytaj #Jak dodać/edytować/usunąć użytkowników sieciowych
sudo testparm sudo /etc/init.d/samba restart
Jak udostępniać pliki do odczytu bez autoryzacji
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak zainstalować serwer Samba do udostępniania plików/folderów
sudo mkdir /home/public sudo chmod 777 /home/public/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- Znajdź
... ; security = user ...
- Zastąp
security = share
- Dopisz na koniec pliku
[public] comment = Public Folder path = /home/public public = yes writable = no create mask = 0777 directory mask = 0777 force user = nobody force group = nogroup
- Zapisz plik
sudo testparm sudo /etc/init.d/samba restart
Jak udostępniać foldery do odczytu/zapisu bez autoryzacji
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak zainstalować serwer Samba do udostępniania plików/folderów
sudo mkdir /home/public sudo chmod 777 /home/public/ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup gksudo gedit /etc/samba/smb.conf
- Znajź
... ; security = user ...
- Zastąp
security = share
- Dodaj na koniec pliku
[public] comment = Public Folder path = /home/public public = yes writable = yes create mask = 0777 directory mask = 0777 force user = nobody force group = nogroup
- Zapisz plik
sudo testparm sudo /etc/init.d/samba restart
Jak drukować na zdalnym komputerze używając serwera Samba
- Przeczytaj #Print Server (cupsd)
- Upewnij się że twoje drukarki są odpowiednio skonfigurowane.
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.backup gedit /etc/samba/smb.conf
- Znajdź
... # printing = cups # printcap name = cups ...
- i usuń znak komentowania (#)
printing = cups printcap name = cups
- Zrestartuj serwer cups
sudo /etc/init.d/cupsys restart
- Od teraz drukarki na twoim komputerze powinny być dostępne przez serwer Samba.
Narzędzie do administrowania serwerem Samba (Samba Web Administration Tool - SWAT)
Jak zainstalować INETD Superserver
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
sudo apt-get install netkit-inetd
Jak zainstalowac SWAT do demona Samba
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
- Przeczytaj #How to install Samba Server for files/folders sharing service
- Przeczytaj #Jak zainstalować INETD Superserver
sudo apt-get install swat
- Otwórz demona konfiguracji inetd.
sudo gksu gedit /etc/inetd.conf
- Jeśli widniej coś takiego:
<#off#> swat stream tcp nowait.400 root /usr/sbin/tcpd /usr/sbin/swat
- Zmień na:
swat stream tcp nowait.400 root /usr/sbin/tcpd /usr/sbin/swat
- Zrestartuj demona
sudo /etc/init.d/inetd restart
Serwer SSH
Jak zainstalować serwer SSH
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
sudo apt-get install ssh
Jak połączyć się przez SSH
- Przeczytaj #Uwagi ogólne
- Zakładamy, że łączymy się zdalnie z komputerem z zainstalowanym Ubuntu oraz SHH
- Przeczytaj #Jak zainstalować serwer SSH
- Adres IP komputera do którego chcemy się zalogować: 192.168.0.1
ssh username@192.168.0.1
Jak skopiować pliki/foldery z zdalnego Ubuntu do lokalnego komputera (scp)
- Przeczytaj #Uwagi ogólne
- Zakładamy, że łączymy się zdalnie z komputerem z zainstalowanym Ubuntu oraz SHH
- Przeczytaj #Jak zainstalować serwer SSH
- Adres IP komputera zdalnego: 192.168.0.1
- Położenie pliku znajdującego się na zdalnym komputerze: /home/username/remotefile.txt
- Położenie folderu docelowego: . (bieżący katalog)
scp -r username@192.168.0.1:/home/username/remotefile.txt .
Jak skopiować pliki/foldery z lokalnego komputeraz do zdalnego Ubuntu (scp)
- Przeczytaj #Uwagi ogólne
- Zakładamy, że łączymy się zdalnie z komputerem z zainstalowanym Ubuntu oraz SHH
- Przeczytaj #Jak zainstalować serwer SSH
- Położenie pliku znajdującego się na lokalnym: localfile.txt
- Adres IP komputera zdalnego: 192.168.0.1
- Remote Ubuntu machine save location: /home/username/
scp -r localfile.txt username@192.168.0.1:/home/username/
Jak skopiować pliki/foldery ze zdalnego komputera na lokalny(rsync)
- Przeczytaj #Uwagi ogólne
- np. Przypuśćmy, że na komputerze zdalnym jest zainstalowany serwer SSH
- Read #How to install SSH Server for remote administration service
- Zdalny komputer: 192.168.0.1
- Pliki/foldery na komputerze zdalnym: /home/username/remotefile.txt
- Miejsce zapisu na komputerze lokalnym: . (wybrany folder)
rsync -v -u -a --delete --rsh=ssh --stats username@192.168.0.1:/home/username/remotefile.txt .
How to copy files/folders from local machine into remote Ubuntu machine (rsync)
- Przeczytaj #Uwagi ogólne
- e.g. Assumed that remote Ubuntu machine have installed SSH Server service
- Read #How to install SSH Server for remote administration service
- Local files/folders location: localfile.txt
- Remote Ubuntu machine: 192.168.0.1
- Remote Ubuntu machine save location: /home/username/
rsync -v -u -a --delete --rsh=ssh --stats localfile.txt username@192.168.0.1:/home/username/
Jak montować foldery ze zdalnego komputera na lokalnym (sshfs)
- Przeczytaj #Uwagi ogólne
- np. Przypuśćmy, że zdalny komputer ma zainstalowany serwer SSH
- Przeczytaj #Jak zainstalować serwer SSH
- Zdalny komputer: 192.168.0.1
- Położenie folderu na zdalnym komputerze: /media/music
- Zainstaluj sshfs
sudo apt-get install sshfs
- Załaduj sterownik kernela dla sshfs
sudo modprobe fuse
- Dołącz do grupy użytkowników 'fuse'
sudo adduser your_user_name fuse
- Wyloguj się i zaloguj, aby podziałało.
- Stwórz lokalny punkt montowania w swoim folderze domowym
mkdir ~/remote_music
- Zamontuj zdalny folder na ~/remote_music
sshfs 192.168.0.1:/media/music ~/remote_music
Jak połączyć się ze zdalnym komputerem(SSH) używając systemu Windows
- Przeczytaj #Uwagi ogólne
- np. Przypuśćmy, że zdalny komputer ma zainstalowany serwer SSH
- Przeczytaj #Jak zainstalować serwer SSH
- Pobierz PuTTY: Here
Jak kopiować pliki/foldery z/do zdalnego komputera przez Windows
- Przeczytaj #Uwagi ogólne
- np. Przypuśćmy, że zdalny komputer ma zainstalowany serwer SSH
- Przeczytaj #Jak zainstalować serwer SSH
- Pobierz FileZilla: Here
Jako ograniczyć konta użytkowników, które mogą połączyć się zdalnie przez SSH
- Przeczytaj #Uwagi ogólne
- np. Jeśli włączysz serwer SSH, każdy użytkownik z poprawnym kontem będzie się mógł połączyć.
- To może być niebezpieczne, gdyż istnieją zdalne programy do łamania haseł, które
- próbują często spotykanych kombinacji loginu i hasła.
- Zrób kopię zapasową pliku konfiguracyjnego serwera SSH
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.ORIGINAL
- Edytuj plik konfiguracyjny
gksudo gedit /etc/ssh/sshd_config
- Zmień parametr PermitRootLogin z yes na no. Superuser nie może mieć możliwości łączenia się bezpośrednio ze zdalnego komputera.
- Dodaj parametr AllowUsers i utwórz listę loginów (oddzielając je spacjami), które mogą łączyć się zdalnie .
- Możesz także użyć parametru DenyUsers, by dokładnie określić wybór użytkowników.
- Jeśli włączasz serwer openssh i nie masz w tej chwili powodu, by zezwalać na zdalne połączenia, możesz dodać parametr AllowUsers nosuchuserhere nie pozwalający połączyć się nikomu.
Serwer DHCP
Jak zainstalować serwer DHCP do automatycznego przydzielania numerów IP
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
- np. Przypuśćmy, że "eth0" jest interfejsem dla naszej karty sieciowej
- Pula adresów IP: 192.168.0.100 to 192.168.0.200
- Maska podsieci: 255.255.255.0
- Serwery DNS: 202.188.0.133, 202.188.1.5
- Domeny: tm.net.my
- Adres bramki sieciowej: 192.168.0.1
sudo apt-get install dhcp3-server sudo cp /etc/default/dhcp3-server /etc/default/dhcp3-server_backup gksudo gedit /etc/default/dhcp3-server
- Znajdź
... INTERFACES=""
- Zmień na:
INTERFACES="eth0"
- Zapisz plik
sudo cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf_backup gksudo gedit /etc/dhcp3/dhcpd.conf
- Znajdź następujący fragment:
... # option definitions common to all supported networks... option domain-name "example.org"; option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600; max-lease-time 7200; ...
- Zmień na:
# option definitions common to all supported networks... #option domain-name "example.org"; #option domain-name-servers ns1.example.org, ns2.example.org;
#default-lease-time 600; #max-lease-time 7200;
- Znajdź następujący fragment:
...
# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# default-lease-time 600;
# max-lease-time 7200;
#}
...
- Zamień na:
# A slightly different configuration for an internal subnet.
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.200;
option domain-name-servers 202.188.0.133, 202.188.1.5;
option domain-name "tm.net.my";
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
default-lease-time 600;
max-lease-time 7200;
}
- Zapisz plik
sudo /etc/init.d/dhcp3-server restart
Serwer baz danych
Jak zainstalować serwer MYSQL
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
sudo apt-get install mysql-server
- Na początku serwers MYSQL pozwala się łączyć tylko z localhost (127.0.0.1). Musimy usunąć wszystkie zakazy na naszym komputerze. Otwórz plik /etc/mysql/my.cnf
gksudo gedit /etc/mysql/my.cnf
- Znajdz bind-address = 127.0.0.1
... #bind-address = 127.0.0.1 ...
- Na początku w serwerze MySQL nie ma hasło roota. To jest ogromne niebezpieczeństwo, więc musisz jakieś ustawić. Lokalny komputer pobiera też hasło roota, więc będziesz musiał je też ustawić. local-machine-name jest nazwa komputera na którym pracujesz. Po więcej informacji klinij here
mysqladmin -u root password your-new-password mysqladmin -h root@local-machine-name -u root -p password your-new-password sudo /etc/init.d/mysql restart
MySQL Database backup using AutoMySQLBackup
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
- Przeczytaj #How to install MYSQL Database Server
- AutoMySQLBackup is a script to take daily, weekly and monthly backups of your MySQL databases using mysqldump.
- AutoMySQLBackup Script Features
- Backup mutiple MySQL databases with one script. (Now able to backup ALL databases on a server easily. no longer need to specify each database seperately)
- Backup all databases to a single backup file or to a seperate directory and file for each database.
- Automatically compress the backup files to save disk space using either gzip or bzip2 compression.
- Can backup remote MySQL servers to a central server.
- Runs automatically using cron or can be run manually.
- Can e-mail the backup log to any specified e-mail address instead of “root”. (Great for hosted websites and databases).
- Can email the compressed database backup files to the specified email address.
- Can specify maximun size backup to email.
- Can be set to run PRE and POST backup commands.
- Choose which day of the week to run weekly backups.
- Pobierz from here
- AutoMySQLBackup Requirements
The AutoMySQLBackup script only requires mysqldump (A standard utility provided with the mysql client) and gzip or bzip2 for compression of the backup files. If you would like to have the log emailed to you then you will need to have permission to execute the “mail” program. If you want the compressed backup files mailed to you then Mutt must be available on the server. Finally you will need a bash shell and the standard system tools and utilities (all these requirements should be the default on most linux system.)
- What AutoMySQLBackup does
Every day AutoMySQLBackup will run (if setup in /etc/cron.daily) and using mysqldump and gzip will dump your specified databases to the /backups/daily directory, it will rotate daily backups weekly so you should never have more than 7 backups in there..
Every Saturday AutoMySQLBackup will again backup the databases you have chosen but they will be placed into /backups/weekly, these will be rotated every 5 weeks so there should never be more than 5 backups in there..
Every 1st of the month AutoMySQLBackup will create a backup of all databases and place them into /backups/monthly. These will never be rotated so it will be up to you to do your own house keeping. I would suggest taking a copy of this offline every month or two so that if you have a hard drive failure you will be able to restore your database
- AutoMySQLBackup Installation
The install is as simple as editing a few variables in the AutoMySQLBackup file. The full setup is documented in the AutoMySQLBackup script file below the variables section.
- Pobierz automysqlbackup.sh and place it into your /etc/cron.daily directory or your home directory.
- Edit (at least) the following lines :
... USERNAME=dbuser PASSWORD=password DBNAMES=”DB1 DB2 DB3″ ...
- Note:The user must have at least select privileges to the databases and make sure to keep the quotes ” ” otherwise it won’t work
- Make the file executable :
sudo chmod u+rwx
- Create the following directory
./backups
- That’s it...Now you can run it using the command line “./automysqlbackup.sh” or if it is in /etc/cron.daily it will run each day when cron
How to install MYSQL Administrator
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
- Przeczytaj #How to install MYSQL Database Server
sudo apt-get install mysql-admin
- Przeczytaj #How to refresh GNOME panel
- Applications -> System Tools -> MySQL Administrator
How to install Oracle Database XE
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
- Przeczytaj http://www.oracle.com/technology/tech/linux/install/xe-on-kubuntu.html
- Add the following repository to your /etc/apt/sources.list:
deb http://oss.oracle.com/debian unstable main non-free
- Install the software using apt-get
sudo apt-get update sudo apt-get install oracle-xe
- Add your login to the 'dba' group (where your login name is username)
sudo usermod -G dba -a username
Serwer HTTP Apache
Jak zainstalować serwer HTTP Apache
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
sudo apt-get install apache2
Jak zainstalować obsługę PHP dla serwera HTTP Apache
Jak zainstalować PHP4
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
- Przeczytaj #How to install Apache HTTP Server for HTTP (Web) Server service
sudo apt-get install php4 sudo apt-get install libapache2-mod-php4 sudo /etc/init.d/apache2 restart
- To test if php4 installed correctly
gksudo gedit /var/www/testphp.php
- Insert the following line into the new file
<?php phpinfo(); ?>
- Zapisz plik
- http://localhost/testphp.php
- Be sure to remove the file afterwards, as it may pose a security risk
Jak zainstalować PHP5
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
- Przeczytaj #Jak zainstalować Apache HTTP Server for HTTP (Web) Server service
sudo apt-get install php5 sudo apt-get install libapache2-mod-php5 sudo /etc/init.d/apache2 restart
- Sprawdzenie czy php5 zostało zainstalowane poprawnie
gksudo gedit /var/www/testphp.php
- Dołącz podaną linię do nowego pliku
<?php phpinfo(); ?>
- Zapisz plik
- http://localhost/testphp.php
- Be sure to remove the file afterwards, as it may pose a security risk
Jak zainstalować MYSQL do Apache HTTP Server
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
- Przeczytaj #Jak zainstalować Apache HTTP Server for HTTP (Web) Server service
- Przeczytaj #Jak zainstalować PHP do Apache HTTP Server
- Przeczytaj #Jak zainstalować MYSQL Database Server
sudo apt-get install libapache2-mod-auth-mysql
- Select either php4-mysql or php5-mysql depending on which version of PHP you installed
sudo apt-get install php<version-number>-mysql sudo apt-get install phpmyadmin
- To get PHP to work with MySQL, open the file (where <version> is either 4 or 5 depending on which PHP you installed)
gksudo gedit /etc/php<version>/apache2/php.ini
- You'll need to uncomment the ";extension=mysql.so" line so that it looks like this
... extension=mysql.so ...
- Save the file then exit
sudo /etc/init.d/apache2 restart
How to install Python for Apache 2
- Przeczytaj #Uwagi ogólne
- Przeczytaj #How to install Apache HTTP Server for HTTP (Web) Server service
sudo aptitude install python sudo aptitude install libapache2-mod-python
How to map URLs to folders outside /var/www/
- Przeczytaj #Uwagi ogólne
- Przeczytaj #How to install Apache HTTP Server for HTTP (Web) Server service
gksudo gedit /etc/apache2/conf.d/alias
- Insert the following lines into the new file
Alias /URL-path /location_of_folder/
<Directory /location_of_folder/> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory>
- Zapisz plik
sudo /etc/init.d/apache2 restart
- When you get "403 - Permission denied", you might try:
chmod o+x /location_of_folder/
- If that doens't work, the following might help:
chmod o+r,o+x /location_of_folder/
How to change the default port number for Apache HTTP Server
- Przeczytaj #Uwagi ogólne
- Przeczytaj #How to install Apache HTTP Server for HTTP (Web) Server service
- e.g. Assumed that new port number is 78
sudo cp /etc/apache2/ports.conf /etc/apache2/ports.conf_backup gksudo gedit /etc/apache2/ports.conf
- Find this line
Listen 80
- Replace with the following line
Listen 78
- Zapisz plik
sudo /etc/init.d/apache2 restart
How to parse RSS into PHP for Apache HTTP Server
- Przeczytaj #Uwagi ogólne
- Przeczytaj #How to install Apache HTTP Server for HTTP (Web) Server service
- Przeczytaj #How to install PHP for Apache HTTP Server
- e.g. Assumed that RSS is DistroWatch.com - News
wget -c http://easylinux.info/uploads/magpierss-0.71.1.tar.gz sudo mkdir /var/www/feeds sudo tar zxvf magpierss-0.71.1.tar.gz -C /var/www/feeds/ sudo mv /var/www/feeds/magpierss-0.71.1/* /var/www/feeds/ sudo rm -fr /var/www/feeds/magpierss-0.71.1/ sudo chown -R www-data:root /var/www/feeds/ gksudo gedit /var/www/feeds/index.php
- Insert the following lines into the new file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>DistroWatch.com - News</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<style type="text/css">
/*<![CDATA[*/
/*
DEFAULT TAG STYLES
*/
body {
background: #ffffff;
margin-left: 20px;
font-family: bitstream vera sans,sans-serif;
font-size: 9pt;
}
h1 {
font-family: luxi sans,sans-serif;
font-size: 15pt;
}
/*]]>*/
</style>
</head>
<body>
<?php
require_once 'rss_fetch.inc';
error_reporting(E_ERROR);
$url = 'http://distrowatch.com/news/dw.xml';
$rss = fetch_rss($url);
if ($rss) {
echo "<h1>";
echo "<a href=$url>", $rss->channel[title], "</a><br/>";
echo "</h1>";
foreach ($rss->items as $item ) {
$url = $item[link];
$title = $item[title];
$description = $item[description];
echo "<li>";
echo "<b>Topic:</b> <a href=$url><b><u>$title</u></b></a><br/><br/>";
echo "$description<br/><br/>";
echo "</li>";
}
}
else {
echo "<a href=$url>", $url, "</a> - Server Down!<br/>";
}
?>
</body>
</html>
- Zapisz plik
- http://localhost/feeds/index.php
Serwer FTP
How to install FTP Server for File Transfer service
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
sudo apt-get install proftpd
How to configure FTP user to be "jailed" (chrooted) into their home directory
- Przeczytaj #Uwagi ogólne
- Przeczytaj #How to install FTP Server for File Transfer service
sudo cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup gksudo gedit /etc/proftpd/proftpd.conf
- Find this section
... DenyFilter \*.*/ ...
- Add the following line below it
DefaultRoot ~
- Zapisz plik
sudo /etc/init.d/proftpd restart
How to configure FTP Server to allow anonymous FTP user to read only
- Przeczytaj #Uwagi ogólne
- Przeczytaj #How to install FTP Server for File Transfer service
sudo cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup gksudo gedit /etc/proftpd/proftpd.conf
- Append the following lines at the end of file
<Anonymous ~ftp> User ftp Group nogroup UserAlias anonymous ftp DirFakeUser on ftp DirFakeGroup on ftp RequireValidShell off MaxClients 10 DisplayLogin welcome.msg DisplayFirstChdir .message <Directory *> <Limit WRITE> DenyAll </Limit> </Directory> </Anonymous>
- Zapisz plik
sudo /etc/init.d/proftpd restart
How to configure FTP Server to allow anonymous FTP user to read/write
- Przeczytaj #Uwagi ogólne
- Przeczytaj #How to install FTP Server for File Transfer service
sudo cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup gksudo gedit /etc/proftpd/proftpd.conf
- Append the following lines at the end of file
<Anonymous ~ftp> User ftp Group nogroup UserAlias anonymous ftp DirFakeUser on ftp DirFakeGroup on ftp RequireValidShell off MaxClients 10 DisplayLogin welcome.msg DisplayFirstChdir .message </Anonymous>
- Zapisz plik
sudo /etc/init.d/proftpd restart
How to map anonymous FTP user to folders outside /home/ftp/
- Przeczytaj #Uwagi ogólne
- Przeczytaj #How to install FTP Server for File Transfer service
sudo cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup gksudo gedit /etc/proftpd/proftpd.conf
- Append the following lines at the end of file
<Anonymous /location_of_folder/> User ftp Group nogroup UserAlias anonymous ftp DirFakeUser on ftp DirFakeGroup on ftp RequireValidShell off MaxClients 10 DisplayLogin welcome.msg DisplayFirstChdir .message <Directory *> <Limit WRITE> DenyAll </Limit> </Directory> </Anonymous>
- Zapisz plik
sudo /etc/init.d/proftpd restart
Jak zmienić standardowy port serwera FTP
- Przeczytaj #Uwagi ogólne
- Przeczytaj #How to install FTP Server for File Transfer service
- np.Portem ma być 77
sudo cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup gksudo gedit /etc/proftpd/proftpd.conf
- Znajdź tą linię
Port 21
- Zamień ją na
Port 77
- Zapisz plik
sudo /etc/init.d/proftpd restart
How to ftp into remote Ubuntu machine via Windows machine
- Przeczytaj #Uwagi ogólne
- e.g. Assumed that remote Ubuntu machine have installed FTP Server service
- Read #How to install FTP Server for File Transfer service
- Pobierz FileZilla: Here
Streaming Media Server
How to install GNUMP3d for Streaming Media Server service
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
- Przeczytaj #How to install Apache HTTP Server for HTTP (Web) Server service
- e.g. /var/music/ is the directory containing multimedia files
sudo apt-get install gnump3d
How to change the default directory containing multimedia files for GNUMP3d
- Przeczytaj #Uwagi ogólne
- Przeczytaj #How to install GNUMP3d for Streaming Media Server service
- e.g. Assumed that new directory containing multimedia files is /home/music/
sudo cp /etc/gnump3d/gnump3d.conf /etc/gnump3d/gnump3d.conf_backup gksudo gedit /etc/gnump3d/gnump3d.conf
- Find this line
root = /var/music
- Replace with the following line
root = /home/music
- Find this line
user = gnump3d
- Replace with the following line
user = root
- Zapisz plik
sudo /etc/init.d/gnump3d restart
Jak zmienić domyślny port dla GNUMP3d
- Przeczytaj #Uwagi ogólne
- Przeczytaj #How to install GNUMP3d for Streaming Media Server service
- e.g. Zakładamy, że nowym portem jest 7878
sudo cp /etc/gnump3d/gnump3d.conf /etc/gnump3d/gnump3d.conf_backup gksudo gedit /etc/gnump3d/gnump3d.conf
- Znajdź tą liniję
port = 8888
- Zastąp tym tekstem
port = 7878
- Zapisz plik
sudo /etc/init.d/gnump3d restart
Serwery Image Gallery
- Dla porównania Gallery1 oraz Gallery2 zobacz here
Gallery1
Jak zainstalować Gallery1 dla usługi Image Gallery Server
- Przeczytaj #Uwagi ogólne
- Przeczytaj #Jak dodać kolejne repozytoria?
- Przeczytaj #How to install Apache HTTP Server for HTTP (Web) Server service
- Przeczytaj #How to install PHP for Apache HTTP Server
sudo apt-get install gallery (jeśli poprosi o restart Apache, wybierz No lub Cancel) sudo apt-get install imagemagick sudo apt-get install jhead sudo apt-get install libjpeg-progs sudo /etc/init.d/apache2 restart sudo sh /usr/share/gallery/configure.sh
- http://localhost/gallery/setup/index.php
- Konfiguracja Gallery
Gallery Configuration Wizard: Step 1 Następny krok ->
Gallery Configuration Wizard: Step 2 General settings Tab -> Admin password: wprowadź hasło Locations and URLs Tab -> Album directory: /var/www/albums/ Temporary directory: /tmp/ Gallery URL: http://localhost/gallery Albums URL: http://localhost/albums Następny krok -->
Gallery Configuration Wizard: Step 3 Następny krok -->
Gallery Configuration Wizard: Step 4 Zapisz konfigurację ->
How to configure Gallery1 to be accessible via Internet (Hostname or fix IP) or LAN (fix IP)
- Przeczytaj #Uwagi ogólne
- Przeczytaj #How to install Gallery1 for Image Gallery Server service
- e.g. Assumed that network and internet connections have been configured properly
- Internet (Hostname or fix IP) or LAN (fix IP): http://www.url.com
sudo cp /etc/gallery/config.php /etc/gallery/config.php_backup gksudo gedit /etc/gallery/config.php
- Find this section
... $gallery->app->photoAlbumURL = "http://localhost/gallery"; $gallery->app->albumDirURL = "http://localhost/albums"; ...
- Replace with the following lines
$gallery->app->photoAlbumURL = "http://www.url.com/gallery"; $gallery->app->albumDirURL = "http://www.url.com/albums";
- Zapisz plik
- http://www.url.com/gallery/albums.php
How to configure Gallery1 to be accessible via LAN (dynamic IP)
- Przeczytaj #Uwagi ogólne
- Przeczytaj #How to install Gallery1 for Image Gallery Server service
- e.g. Assumed that network connections have been configured properly
- LAN (dynamic IP): 192.168.0.1
sudo cp /etc/gallery/config.php /etc/gallery/config.php_backup gksudo gedit /etc/gallery/config.php
- Find this section
... $gallery->app->photoAlbumURL = "http://localhost/gallery"; $gallery->app->albumDirURL = "http://localhost/albums"; ...
- Replace with the following lines
$gallery->app->photoAlbumURL = "/gallery"; $gallery->app->albumDirURL = "/albums";
- Zapisz plik
- http://192.168.0.1/gallery/albums.php
How to backup/restore Gallery1 data
- Przeczytaj #Uwagi ogólne
- To backup Gallery data
sudo tar zcvf gallery.tgz /var/www/albums/ /etc/gallery/
- To restore Gallery data
sudo tar zxvf gallery.tgz -C /
Gallery2
Jak zainstalować Gallery2
Jak skonfigurować Gallery2
How to install Subversion version control server (svnserve)
- Przeczytaj #Uwagi ogólne
- Install Subversion and Internet services daemon
sudo apt-get install subversion xinetd
- Create user that will own the repositories
sudo adduser --system --no-create-home --home /var/svn --group --disabled-login svn
- Create directory that will hold the repositories
sudo mkdir /var/svn sudo chown svn:svn /var/svn
- Create file /etc/xinetd.d/svnserve with the following content
service svn
{
port = 3690
socket_type = stream
protocol = tcp
wait = no
user = svn
server = /usr/bin/svnserve
server_args = -i -r /var/svn
}
- Restart xinetd
sudo /etc/init.d/xinetd restart
- Create the first repository
sudo -u svn svnadmin create /var/svn/testrepo
- It should be possible to check out the repository and work on it
svn co svn://localhost/testrepo

