Ubuntu Suomen keskustelualueet
Ubuntun käyttö => Ohjelmointi, palvelimet ja muu edistyneempi käyttö => Aiheen aloitti: Napsteri - 11.03.08 - klo:21.09
-
Terve,
Asensin ubuntu 7.10 ja siihen tän: http://wiki.ubuntu-fi.org/LAMP_Asennus ohjeen mukaisesti apachen, mysqln ja phpn. Kaikki toimii ihan ok, mutta ihan viimeinen kohta eli
Tee omaan kotihakemistoosi hakemisto, jonka nimi on public_html.
esimerkiksi käyttäjälle user, hakemisto tehdään näin:
mkdir /home/user/public_html
Nyt public_html hakemiston sisältö näkyy apachessa osoitteessa http://localhost/~user
En saa toimimaan. Millaiset oikeudet tuolle omalle hakemistolle pitää antaa, että sinne pääsee tuolla localhost/~käyttäjä osoitteella?
Nyt se sanoo vaan tälleen:
Not Found
The requested URL /~napsteri was not found on this server.
Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6.3 Server at localhost Port 80
ps. kiitos hyvästä ohjeesta tekijälle. Tämä antoi ihan uutta puhtia linuxin ja phpn opetteluun.
-
En saa toimimaan. Millaiset oikeudet tuolle omalle hakemistolle pitää antaa, että sinne pääsee tuolla localhost/~käyttäjä osoitteella?
oikeudet ovat yleensä 711 tai jos haluaa hakemistolistauksen näkyville niin 755. tosin veikkaan tässä olevan kyse siitä, että sinulla ei ole userdir-modulia ladattuna.
kokeile seuraavaa:
$ sudo a2enmod userdir
$ sudo /etc/init.d/apache2 force-reload
ja lataa sivu uudestaan.
-
Kiitos Janne tämä ratkesi tällä. Myöskään tämä:
Selainpohjaisen tietokannanohjaustyökalun lisääminen (PHPMyAdmin)
Päätteessä:
sudo aptitude install phpmyadmin
PHPMyadminin pitäisi näkyä osoitteessa:http://localhost/phpmyadmin
ei toimi, mutta en kyllä tiedä tarvinko sitä mihinkään :) valittaa samaa, not found on this server
-
mutta en kyllä tiedä tarvinko sitä mihinkään :)
Jos tarkoituksesi on käsitellä MySQL:ää, niin Webmin tekee saman mitä phpMyAdmin.
http://wiki.ubuntu-fi.org/Webmin
http://forum.ubuntu-fi.org/index.php?topic=6362.0 - Ruutukaappaukset lopussa, pklaskun ohje on sinänsä vanhentunut...
Ystävällisin terveisin Asmo Koskinen.
-
Serverin asetukset osoittaa muualle kuin /home/~user/public_html/ kansioon.
Jos laitat selaimelle vaan http://localhost näet tuloksen.
Tällä ohjeella itse sain toimimaan:
Virtual Hosts
Apache2 has the concept of sites, which are separate configuration files that Apache2 will read. These are available in /etc/apache2/sites-available. By default,
there is one site available called default this is what you will see when you browse to [WWW] http://localhost or [WWW] http://127.0.0.1. You can have many different
site configurations available, and activate only those that you need.
As an example, we want the default site to be /home/user/public_html/. To do this, we must create a new site and then enable it in Apache2.
To create a new site:
* Copy the default website as a starting point. sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mysite
* Edit the new configuration file in a text editor "sudo nano" on the command line or "gksudo gedit", for example: gksudo gedit /etc/apache2/sites-available/mysite
* Change the DocumentRoot to point to the new location. For example, /home/user/public_html/
* Change the Directory directive, replace <Directory /var/www/> to <Directory /home/user/public_html/>
* You can also set separate logs for each site. To do this, change the ErrorLog and CustomLog directives. This is optional, but handy if you have many sites
* Save the file
Now, we must deactivate the old site, and activate our new one. Ubuntu provides two small utilities that take care of this: a2ensite (apache2enable site) and a2dissite (apache2disable site).
sudo a2dissite default && sudo a2ensite mysite
Finally, we restart Apache2:
sudo /etc/init.d/apache2 restart
If you have not created /home/user/public_html/, you will receive an warning message
To test the new site, create a file in /home/user/public_html/:
echo '<b>Hello! It is working!</b>' > /home/user/public_html/index.html
Finally, browse to [WWW] http://localhost/
Lähde: https://help.ubuntu.com/community/ApacheMySQLPHP
-
MIstäs löytyis PHP? Yritin ettiä mutta löytyi vaina PHP virallisilta sivuilta lähdekoodi ja Windowsin binäärit. ???
-
MIstäs löytyis PHP? Yritin ettiä mutta löytyi vaina PHP virallisilta sivuilta lähdekoodi ja Windowsin binäärit. ???
samasta paikasta kuin valtaosa muustakin softasta, eli paketinhallinnan kautta ubuntun omista repositoryistä.
$ apt-cache policy php5
php5:
Installed: (none)
Candidate: 5.2.4-2ubuntu5.1
Version table:
5.2.4-2ubuntu5.1 0
500 http://fi.archive.ubuntu.com hardy-updates/main Packages
5.2.4-2ubuntu5 0
500 http://fi.archive.ubuntu.com hardy/main Packages
näkyy olevan vielä ihan mainissa.