Apache2 asentaminen ja palomuurin asentaminen

a) Ensin annoin komennon sudo apt-get update. Sen jälkeen kirjoitin komennon sudo apt-get install apache2. Kun olin asentananut Apache2, kokeilin pääsenkö testisivulle
kirjoittamalla osoiteriville http://localhost. –tähän kuva–. Sen jälkeen kun olin kokeillut localhost:ia kokeilin ip-osoitteella.Apache asennuksen jälkeen laitoin palo-
muurin päälle komenolla sudo ufw enable ja avasin portin 80 komennolla sudo ufw allow 80/tcp.

PHP:n asentaminen

Seuraavaksi asensin libapache-mod
paketin komennolla sudo apt-get install libapache2-mod-php. Asennuksen jälkeen menin komennolla sudoedit /etc/apache2/mods-available/php7.0.conf konfiguroimaan
tiedostoa. Kommentoin koko if lause rakenteen.

Ps. En saannut  PHP:tä toimimaan testisivulla. terminal-lauriwinblows-_004

Mysql asentaminen

Asensin Mysql server ja client:in komenolla sudo apt-get install mysql-server mysql-client. Annoin salasanan mysql root käyttäjälle. Sitten kirjoitin komennon
mysql -u root -p, annoin salasanan ja pääsin luomaan tietokannan. Loin komennolla CREATE DATABASE student CHARACTER SET utf8;. Tietokanna luonnin jälkeen
kirjoitin komennon show database; jolla näin tietokannan rakenteen. Loin uuden käyttäjän komenolla GRANT ALL ON student.* TO student@localhost IDENTIFIED BY ‘dk387KaaJEE-.d//NA’;
Student käyttäjän luonnin jälkeen automatisoin student käyttäjän kirjautumisen komenolla nano .my.cnf
editorissa laitoin student käyttäjän tiedot ja mihin tietokantaan hänellä on oikeus tehdä muutoksia.

d)

/var/log/syslog <== Feb 13 13:02:18 winblows ModemManager[878]: couldn’t load list of Own Numbers: ‘SIM PIN required’ Feb 13 13:02:18 winblows NetworkManager[924]: [1486983738.9186] device (ttyACM1): state change: unmanaged -> unavailable (reason ‘none’) [10 20 0]
Feb 13 13:02:18 winblows NetworkManager[924]: [1486983738.9191] device (ttyACM1): modem state ‘locked’
Feb 13 13:02:18 winblows NetworkManager[924]: [1486983738.9210] manager: (ttyACM1): new Broadband device (/org/freedesktop/NetworkManager/Devices/6)
Feb 13 13:04:18 winblows dbus[902]: [system] Activating service name=’com.ubuntu.SoftwareProperties’ (using servicehelper)
Feb 13 13:04:19 winblows dbus[902]: [system] Successfully activated service ‘com.ubuntu.SoftwareProperties’
Feb 13 13:05:35 winblows systemd[1]: Starting Cleanup of Temporary Directories…
Feb 13 13:05:35 winblows systemd-tmpfiles[2772]: [/usr/lib/tmpfiles.d/var.conf:14] Duplicate line for path “/var/log”, ignoring.
Feb 13 13:05:35 winblows systemd[1]: Started Cleanup of Temporary Directories.
Feb 13 13:09:01 winblows CRON[2859]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && /usr/lib/php/sessionclean)

==> /var/log/auth.log <== Feb 13 12:53:28 winblows gnome-keyring-daemon[1300]: asked to register item /org/freedesktop/secrets/collection/login/1, but it’s already registered Feb 13 12:53:52 winblows dbus[902]: [system] Failed to activate service ‘org.bluez’: timed out Feb 13 13:04:31 winblows sudo: lauri : TTY=pts/0 ; PWD=/home/lauri ; USER=root ; COMMAND=/usr/bin/apt-get update Feb 13 13:04:31 winblows sudo: pam_unix(sudo:session): session opened for user root by lauri(uid=0) Feb 13 13:04:39 winblows sudo: pam_unix(sudo:session): session closed for user root Feb 13 13:05:42 winblows pkexec: pam_unix(polkit-1:session): session opened for user root by (uid=1000) Feb 13 13:05:42 winblows pkexec: pam_systemd(polkit-1:session): Cannot create session: Already running in a session Feb 13 13:05:42 winblows pkexec[2780]: lauri: Executing command [USER=root] [TTY=unknown] [CWD=/home/lauri] [COMMAND=/usr/lib/update-notifier/package-system-locked] Feb 13 13:09:01 winblows CRON[2858]: pam_unix(cron:session): session opened for user root by (uid=0) Feb 13 13:09:01 winblows CRON[2858]: pam_unix(cron:session): session closed for user root ==> /etc/lsb-release <== DISTRIB_ID=Ubuntu DISTRIB_RELEASE=16.04 DISTRIB_CODENAME=xenial DISTRIB_DESCRIPTION=”Ubuntu 16.04.1 LTS” ==> /var/log/apache2/access.log <== 127.0.0.1 – – [12/Feb/2017:16:41:02 +0200] “GET /~vagrant/ HTTP/1.1” 404 443 “-” “curl/7.47.0” 127.0.0.1 – – [13/Feb/2017:12:53:49 +0200] “GET / HTTP/1.1” 200 3525 “-” “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36” 127.0.0.1 – – [13/Feb/2017:12:53:49 +0200] “GET /icons/ubuntu-logo.png HTTP/1.1” 200 3623 “http://localhost/&#8221; “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36” 127.0.0.1 – – [13/Feb/2017:12:53:49 +0200] “GET /favicon.ico HTTP/1.1” 404 500 “http://localhost/&#8221; “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36” 127.0.0.1 – – [13/Feb/2017:12:59:43 +0200] “GET /index.php HTTP/1.1” 404 499 “-” “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36” 127.0.0.1 – – [13/Feb/2017:13:06:16 +0200] “-” 408 0 “-” “-” 127.0.0.1 – – [13/Feb/2017:13:06:16 +0200] “-” 408 0 “-” “-” 127.0.0.1 – – [13/Feb/2017:13:06:16 +0200] “-” 408 0 “-” “-” ==> /var/log/apache2/error.log <== [Sun Feb 12 16:40:23.251544 2017] [mpm_prefork:notice] [pid 1243] AH00169: caught SIGTERM, shutting down [Sun Feb 12 16:40:24.408237 2017] [mpm_prefork:notice] [pid 14827] AH00163: Apache/2.4.18 (Ubuntu) configured — resuming normal operations [Sun Feb 12 16:40:24.408297 2017] [core:notice] [pid 14827] AH00094: Command line: ‘/usr/sbin/apache2’ [Sun Feb 12 17:00:38.033177 2017] [mpm_prefork:notice] [pid 14827] AH00169: caught SIGTERM, shutting down [Sun Feb 12 17:00:39.189487 2017] [mpm_prefork:notice] [pid 15785] AH00163: Apache/2.4.18 (Ubuntu) configured — resuming normal operations [Sun Feb 12 17:00:39.189550 2017] [core:notice] [pid 15785] AH00094: Command line: ‘/usr/sbin/apache2’ [Sun Feb 12 18:44:42.938501 2017] [mpm_prefork:notice] [pid 15785] AH00169: caught SIGTERM, shutting down [Mon Feb 13 12:50:34.985012 2017] [mpm_prefork:notice] [pid 1271] AH00163: Apache/2.4.18 (Ubuntu) configured — resuming normal operations [Mon Feb 13 12:50:34.985195 2017] [core:notice] [pid 1271] AH00094: Command line: ‘/usr/sbin/apache2’ [Mon Feb 13 12:59:43.848523 2017] [:error] [pid 1276] [client 127.0.0.1:44432] script ‘/var/www/html/index.php’ not found or unable to stat ==> /var/log/apache2/other_vhosts_access.log <== ==> /proc/uptime <==
1500.21 5886.59

Advertisements