LAMP muodostuu osista Linux, Apache, MySQL ja PHP. Tässä artikkelissa käymme läpi asennuksen Debian 8.0 (Jessie)-Linux-jakelulle. Asennusprosessi ei ole sama eri jakeluille ja/tai versioille, mutta tätä ohjetta voi kätevästi soveltaa myös asennuksiin muille jakeluille. Lähtökohtaisesti olet kirjautuneena sisään palvelimen pääkäyttäjänä (root) ja käytössä käyttöjärjestelmän puhdas asennus, jossa toimii verkkoyhteydet.

Päivitetään nykyiset paketit ja tarkastetaan, että palvelimen aika on määritetty oikein.

apt-get update
apt-get upgrade  
dpkg-reconfigure tzdata

Tämän jälkeen asennetaan oheiset paketit APT-paketinhallinnasta. Lisätietoa asennettavista paketeista löydät täältä.

apt-get install apache2 mysql-server php5-gd php5-mcrypt php5-mysql 
php-apc php5-imagick php5-memcache libapache2-mod-php5 php-pear ntp

MySQL pyytää asentuessaan MySQL:n pääkäyttäjän (root) salasanaa, joten keksi sille hyvä ja turvallinen salasana.

Optimoidaan MySQL-tietokannan määrityksiä käyttäen nano-tekstieditoria.

nano /etc/mysql/my.cnf

Muuta seuraavien muuttujien arvot:

    key_buffer_size = 128M
    table_cache = 1024
    max_connections = 300

Tässä vaiheessa voidaan jo luoda tietokanta ja -käyttäjä, mahdollista verkkosivua tai palvelua varten. Siirrytään MySQL-tulkkiin, josta tehdää luontilauseet ja annetaan oikeudet. Tämä onnistuu seuraavasti.

mysql -u root -p

CREATE USER 'kayttajatunnus'@'localhost' IDENTIFIED BY 'salasana';
CREATE DATABASE tietokannan_nimi;
GRANT ALL ON tietokannan_nimi.* to kayttajatunnus@localhost;
FLUSH DATABASE PRIVILEGES;

Luodaan sivustolle www-juurihakemisto, muutetaan se apachen oletuskäyttäjälle (www-data) ja apacheen virtualhost. Muista korvata www.sivusto.fi omalla sivustollasi.

mdir /var/www/www.sivusto.fi
chown www-data:www-data /var/www/www.sivusto.fi
nano /etc/apache2/sites-available/www.sivusto.fi


	ServerName www.sivusto.fi
        ServerAlias sivusto.fi
	DocumentRoot /var/www/www.sivusto.fi
	ServerAdmin webmaster@sivusto.fi
	RewriteEngine on
		Options FollowSymLinks MultiViews
                Options -Indexes
	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	ErrorLog ${APACHE_LOG_DIR}/www.sivusto.fi_error.log
	LogLevel warn
	CustomLog ${APACHE_LOG_DIR}/www.sivusto.fi_access.log combined

Otetaan sivusto (virtualhost) ja Apachen rewrite-moduuli käyttöön, jonka jälkeen käynnistetään Apache uudelleen.

a2ensite www.sivusto.fi
a2enmod rewrite
/etc/init.d/apache2 restart

Tarvitseeko palvelimelta lähettää sähköposteja? (esim. julkaisujärjestelmä tmv.) Helpoin tapa saada sähköpostit käyttöön on asentaa exim4

apt-get install exim4
dpkg-reconfigure exim4-config

Tämän jälkeen käynnistyy Eximin asennus-wizard, jossa määrität palvelun asetukset. Exim tulee määrittää lähettämään sähköpostiviestejä Internettiin ilman smarthosteja ja SMTP:tä tulisi kuunnella vain localhostista. Muuten asetukset toimivat oletuksena tai domain-kohtaisesti.

Nyt voit vielä testata asennustasi, esimerkiksi luomalla index.html:n www-juurihakemiston juureen.

nano /var/www/www.sivusto.fi/index.html

hello world

Jos verkkotunnuksesi ei vielä tässä vaiheessa osoita palvelimen IP-osoitteeseen, niin voit tarkastaa saatko Apachen oletussivun näkyviin avaamalla palvelimen IP-osoitteen (http://123.123.123.123) selaimessasi. Tämä pitäisi tulostaa sivu ”It works!”

Screen Shot 2015-11-26 at 16.23.39

Comments

  1. Pingback: augmentin 875 stomach issues after

  2. Pingback: viagra for men

  3. Pingback: sildenafil 100mg price

  4. Pingback: cialis professional

  5. Pingback: tadalafil pills

  6. Pingback: tadalafil cheap

  7. Pingback: cheap cialis

  8. Pingback: oxybutynin side effects

  9. Pingback: does viagra work

  10. Pingback: viagra for women

  11. Pingback: abilify tongue stick out

  12. Pingback: what is allopurinol 100mg

  13. Pingback: amiodarone replacement

  14. Pingback: amlodipine besylate olmesartan medoxomil

  15. Pingback: what does amoxicillin treat

  16. Pingback: abilify side effects in women

  17. Pingback: canada pharma limited llc

  18. Pingback: online pharmacy viagra

  19. Pingback: canadian online pharmacy

  20. Pingback: mexican pharmacies

  21. Pingback: Anafranil

  22. Pingback: buspirone classification

  23. Pingback: carvedilol 25 mg tab image

  24. Pingback: celebrex tylenol

  25. Pingback: is celexa an ssri

  26. Pingback: what is viagra

  27. Pingback: cialis online purchase

  28. Pingback: how to get viagra

  29. Pingback: viagra for women

  30. Pingback: generic cialis

  31. Pingback: free coupon 3 day trial cialis

  32. Pingback: pharmacy rx one viagra

  33. Pingback: when will cialis go generic in usa

  34. Pingback: can i exercise on viagra

  35. Pingback: 365 pills viagra cialis professional

  36. Pingback: cialis price per pill

  37. Pingback: 20mg cialis generic

  38. Pingback: cialis dapoxetine australia

  39. Pingback: curved penis and cialis

  40. Pingback: viagra paypal canada

  41. Pingback: fish mox amoxicillin

  42. Pingback: where to buy azithromycin

  43. Pingback: can celebrex cause mouth sores

  44. Pingback: non allergic reaction to amoxicillin

  45. Pingback: azithromycin 500mg for 3 days

  46. Pingback: xjblxlfw

  47. Pingback: cephalexin product insert

  48. Pingback: cymbalta treats

  49. Pingback: why did my doc prescribe mg zithromax

  50. Pingback: who manufactures sildenafil

  51. Pingback: does cialis have testosterone

  52. Pingback: is cialis over the counter

  53. Pingback: viagra

  54. Pingback: cheap writing service

  55. Pingback: can someone write my research paper for me

  56. Pingback: what should i write my personal essay about

  57. Pingback: help me create a title for a essay

  58. Pingback: viagra soft tabs 100mg usa

  59. Pingback: amoxicillin buy

  60. Pingback: furosemide otc

  61. Pingback: 100 mg azithromycin

  62. Pingback: ivermectin stromectol

  63. Pingback: ventolin pharmacy uk

  64. Pingback: viagra professional

  65. Pingback: viagra before after

  66. Pingback: viagra dose

  67. Pingback: viagra coupons

  68. Pingback: what is levitra

  69. Pingback: viagra india

  70. Pingback: viagra accident

  71. Pingback: too much viagra

  72. Pingback: viagra results

  73. Pingback: doxycycline strengths

  74. Pingback: reducing prednisolone

  75. Pingback: who makes cialis

  76. Pingback: clomid medication

  77. Pingback: levitra dosage

  78. Pingback: free cialis samples

  79. Pingback: teva viagra cost

  80. Pingback: paxil or priligy

  81. Pingback: generic viagra reviews

  82. Pingback: cialis versus viagra

  83. Pingback: effects of diflucan

  84. Pingback: viagra pills for sale

  85. Pingback: synthroid moa

  86. Pingback: discount viagra

  87. Pingback: sildenafil 50 mg

  88. Pingback: help me write an essay

  89. Pingback: how to write thesis

  90. Pingback: essay writing service best

  91. Pingback: how to write dissertation proposal

  92. Pingback: writing your thesis

  93. Pingback: the best essay writers

  94. Pingback: best essay review services

  95. Pingback: how to write a dissertation

  96. Pingback: propecia,

  97. Pingback: cheapest custom essay writing

  98. Pingback: write my paper in apa format

  99. Pingback: do you need a prescription for cialis

  100. Pingback: sildenafil for ed information

  101. Pingback: herbal viagra ingredients

  102. Pingback: viagra vs yohimbe

  103. Pingback: costco price cialis 5 mg 30 pills

  104. Pingback: va medicine cost for viagra

  105. Pingback: new white pill viagra

  106. Pingback: substitute for cialis daily use

  107. Pingback: women have you tried viagra

  108. Pingback: brother takes viagra

  109. Pingback: generic cialis paypal payment

  110. Pingback: sister helps with viagra boner

  111. Pingback: getting off neurontin

  112. Pingback: sildenafil us pharmacy

  113. Pingback: topamax and metformin

  114. Pingback: paxil vs prozac

  115. Pingback: plaquenil skin rash

  116. Pingback: synthesis of celebrex

  117. Pingback: cephalexin same as amoxicillin

  118. Pingback: cymbalta ssri or snri

  119. Pingback: viagra generic online pharmacy

  120. Pingback: discount pharmacies

  121. Pingback: how to buy generic cialis online

  122. Pingback: tadalafil online usa

  123. Pingback: buy viagra cvs south africa

  124. Pingback: acheter viagra wikipedia

  125. Pingback: eumed order cialis generico online

  126. Pingback: cialis generic canada

  127. Pingback: cialis generico 40 order

  128. Pingback: sildenafil 100mg mexico

  129. Pingback: cialis online amazon singapore

  130. Pingback: buy generic cialis australia

  131. Pingback: generic cialis fast delivery

  132. Pingback: best generic cialis prices

  133. Pingback: buy viagra amazon australia

  134. Pingback: sildenafil price australia

  135. Pingback: cheap cialis online australia

  136. Pingback: sildenafil 58

  137. Pingback: generic cialis cost australia

  138. Pingback: can you buy real cialis online

  139. Pingback: canada prescriptions drugs

  140. Pingback: viagra buy online india

  141. Pingback: generic tadalafil 2018

  142. Pingback: cialis in europe

  143. Pingback: generic levitra from india singapore

  144. Pingback: qual melhor viagra cialis levitra

  145. Pingback: Glucophage

  146. Pingback: buy cialis drug

  147. Pingback: prescription price comparison

  148. Pingback: cialis super active

  149. Pingback: order cialis

  150. Pingback: cialis free 30 day supply

  151. Pingback: payday advance loans hawthorne

  152. Pingback: advance america cash advance cypress

  153. Pingback: viagra retinal vessel occlusion

  154. Pingback: buy tretinoin online

  155. Pingback: side effects of viagra suppository

  156. Pingback: payday loan payday loans

  157. Pingback: tinder verification code

  158. Pingback: cash advance payday loan birmingham

  159. Pingback: viagra da alma

  160. Pingback: will 10 year old viagra work

  161. Pingback: taking soft tabs

  162. Pingback: buy online viagra

  163. Pingback: buy online viagra

  164. Pingback: frauen anschreiben beispiel lovoo

  165. Pingback: buy ativan online paypal

  166. Pingback: free battery women dating

  167. Pingback: cialis for high blood pressure

  168. Pingback: cialis over the counter in spain

  169. Pingback: cialis com free sample

  170. Pingback: free chat dating sites no sign up

  171. Pingback: adult dating site in 2008

  172. Pingback: what color is cialis

  173. Pingback: humana rx pharmacy

  174. Pingback: generic cialis 10 mg price cheap

  175. Pingback: testosterone cream online pharmacy

  176. Pingback: rx city pharmacy auburn ny

  177. Pingback: otc generic cialis

  178. Pingback: viagra 25mg cost

  179. Pingback: viagra gel

  180. Pingback: purchase tadalafil online

  181. Pingback: cialis cheaper

  182. Pingback: viagra for sale

  183. Pingback: sildenafil 20mg

  184. Pingback: online dating first message generator

  185. Pingback: rami malek dating lucy boynton

  186. Pingback: cialis trial coupon

  187. Pingback: sildenafil viagra

  188. Pingback: tadalafil generic cost

  189. Pingback: cytotmeds.com

  190. Pingback: gabapentin for pain

  191. Pingback: goodrx cialis

  192. Pingback: bayer levitra

  193. Pingback: viagra walmart

  194. Pingback: https://datingsitesover.com/

  195. Pingback: amlodipine and viagra

  196. Pingback: how to find out if someone is registered on a dating site for free

  197. Pingback: reddit sugar dating

  198. Pingback: lipitor dosage

  199. Pingback: warnings for meloxicam

  200. Pingback: metoprolol er

  201. Pingback: losartan recall

  202. Pingback: viagra price

  203. Pingback: tadalafil

  204. Pingback: walmart levitra price

  205. Pingback: cymbalta withdrawal symptoms

  206. Pingback: prednisone withdrawal

  207. Pingback: elavil

  208. Pingback: duloxetine 20mg cap

  209. Pingback: microzide hydrochlorothiazide

  210. Pingback: metformin er recall

  211. Pingback: mirtazapine for sleep in elderly

  212. Pingback: a keto diet

  213. Pingback: keto diet vegetables

  214. Pingback: starting the keto diet

  215. Pingback: wellbutrin smoking cessation

  216. Pingback: buspar side effects

  217. Pingback: celexa

  218. Pingback: tizanidine hcl 4mg

  219. Pingback: wellbutrin 300 mg

  220. Pingback: diclofenac sodium 75 mg

  221. Pingback: clonidine half life

  222. Pingback: finasteride 1mg

  223. Pingback: carvedilol side effects

  224. Pingback: flagyl 400 mg

  225. Pingback: best tadalafil

  226. Pingback: 200 mg viagra

  227. Pingback: cialis 50mg price

  228. Pingback: revatio vs viagra

  229. Pingback: buy prednisone 5 mg online

  230. Pingback: vardenafil hcl 20mg tab

  231. Pingback: dosage of plaquenil for coronavirus

  232. Pingback: low cost priligy

  233. Pingback: acyclovir cream 50mg

  234. Pingback: amoxicillin capsule 500mg price

  235. Pingback: donepezil purpose

  236. Pingback: amoxicillin 500 mg

  237. Pingback: zithromax capsules 250mg

  238. Pingback: cefdinir generation

  239. Pingback: keflex for uti

  240. Pingback: clindamycin phosphate topical

  241. Pingback: erythromycin 250 mg cost

  242. Pingback: zithromax tablets price

  243. Pingback: cialis forms

  244. Pingback: price cialis 20 mg

  245. Pingback: tadalafil 10mg cost

  246. Pingback: levitra and alcohol

  247. Pingback: liquid tadalafil citrate

  248. Pingback: lowest price cialis 20mg

  249. Pingback: levitra vardenafil 40 mg

  250. Pingback: viagra patent expiration

  251. Pingback: fast acting inhalers

  252. Pingback: hydroxychloroquine sulfate uses

  253. Pingback: cialis soft generic

  254. Pingback: daily cialis dosage

  255. Pingback: sildenafil 50mg brand name

  256. Pingback: viagra dosage recommendations

  257. Pingback: citrate sildenafil

  258. Pingback: viagra sales

  259. Pingback: female viagra reviews

  260. Pingback: sildenafil 100mg coupon

  261. Pingback: viagra and alcohol

  262. Pingback: amlodipine besylate 5mg tablets

  263. Pingback: levitra 20mg coupon

  264. Pingback: metformin diarrhea

  265. Pingback: cheapest cialis prices

  266. Pingback: what is amoxicillin

  267. Pingback: doxycycline

  268. Pingback: furosemide 500 mg

  269. Pingback: xenical price in usa

  270. Pingback: dapoxetine brand in india

  271. Pingback: finasteride for women

  272. Pingback: careprost india

  273. Pingback: clomiphene citrate clomid serophene

  274. Pingback: can fluconazole cause diarrhea

  275. Pingback: motilium med

  276. Pingback: can nolvadex reverse gynecomastia

  277. Pingback: prednisolone ophthalmic side effects

  278. Pingback: naltrexone injection protocol

  279. Pingback: plaquenil over the counter walgreens

  280. Pingback: valacyclovir hcl 1g

  281. Pingback: tizanidine with celecoxib

  282. Pingback: hydroxychloroquine off patent

  283. Pingback: tadalafil citrate powder

  284. Pingback: cialis savings coupon

  285. Pingback: ciprofloxacin ophthalmic cost

  286. Pingback: cialis generico

  287. Pingback: cialis canada pharmacy

  288. Pingback: purchase peptides tadalafil

  289. Pingback: sildenafil 20mg daily

  290. Pingback: extra super viagra

  291. Pingback: buy viagra online

  292. Pingback: hydroxychloroquine and kidney disease