Heavymind
Gdyby ludzie rozmawiali tylko o tym, co rozumieją, zapadłaby nad światem wielka cisza.

06/10/2007

Instalacja serwera Apache, PHP i MySQL dla aplikacji Zend Framework

Opublikowane jako: Apache, Zend — Tags: , , , , , , — Kubek Bartosz @ 18:19

Kilkakrotnie już, czytelnicy samouczka Zend Framework zwracali się o pomoc w konfiguracji środowiska testowego, tak by móc z sukcesem uruchomić zawarte na łamach tego bloga przykłady.

Z myślą o Was, jak i o każdej kolejnej osobie, która zaczyna zabawę w programowanie - czy to z Zend Frameworkiem, czy to w ogóle stron www w języku PHP, napisałem kolejny artykuł.

Instalacja WAMP dla Zend Framework” jest tutorialem, który w szczegółowy sposób opisuje elementarne kroki jakie należy wykonać by uruchomić jakąkolwiek aplikację PHP5 (w szczególności opartą o Zend Framework).Mam nadzieję, że będzie on wartościowy dla osób szukających pomocy w tym temacie.



Instalation of Apache with PHP and MySQL servers for Zend Framework based application

Opublikowane jako: Apache, Zend — Tags: , , , , , , — Kubek Bartosz @ 18:12

Was it a few times already, when Zend Framework Tutorial readers have came to me with questions about their problems with testing environment configuration. They couldn’t successfully test Tutorial scripts.

And here comes out for Your needs - yet another tutorial I’ve made for not only Zend Framework beginners, but also for Y’all who wish to start Your first PHP applications.

WAMP instalation for Zend Framework based applications” is a tutorial, that describes in details basic steps that needs to be made, to properly install and configure a PHP5 application (Zend Framework based as well). Hope that people searching for a help in this area will enjoy it and find it useful.

ps: I’ts in polish only. Sorry



25/07/2007

koszmar z VirtualHost’ami w SuSE

Opublikowane jako: Apache — Tags: , — Kubek Bartosz @ 23:38

Chciałbym się podzielić problemem, który zawłaszczył sobie masę mego czasu przez ostatnie dni, a związany jest z vHostami serwera Apache2 zainstalowanego na sysyemie openSuse linux. Opisuję to, ponieważ mam nadzieję, że mój wywód będzie pomocny dla osób które również spotkają się z tym dziwnym problemem, a zaświadczam, iż rozwiązanie go to nie była łatwa rzecz (tym bardziej gdy rozwiązania szuka się głównie metodą własnych “prób i błędów”).
Tak więc moim celem było uruchomienie kilku vHostów na nowo postawionym serwerze Apache2. W tym celu stworzyłem następujące dyrektywy w pliku /etc/apache2/vhosts.d/vhosts.conf :

   <virtualhost *:80>
      ServerAdmin webmaster@somedomain.com
      DocumentRoot /srv/www/somedomain
      ServerName www.somedomain.com
      ServerAlias somedomain.com
   </virtualhost>
   <virtualhost *:80>
      ServerAdmin webmaster@elsedomain.com
      DocumentRoot /srv/www/elsedomain
      ServerName www.elsedomain.com
      ServerAlias elsedomain.com
   </virtualhost>
   <virtualhost *:80>
      ServerAdmin webmaster@otherdomain.com
      DocumentRoot /srv/www/otherdomain
      ServerName www.otherdomain.com
      ServerAlias otherdomain.com
   </virtualhost>

Uzupełnieniem tego było umieszczenie następujących linii w pliku /etc/hosts :

   127.0.0.1     www.somedomain.com
   127.0.0.1     somedomain.com
   127.0.0.1     www.elsedomain.com
   127.0.0.1     elsedomain.com
   127.0.0.1     www.otherdomain.com
   127.0.0.1     otherdomain.com

I to wszystko. Pozostaje już tylko zrestartować proces Apache poprzez:

   apache2ctl restart

i błąd gotowy! Oto co wyświetla się podczas uruchamiania ponownego instancji Apache:

   [Wed Jul 25 21:42:59 2007]
      [warn] _default_ VirtualHost overlap on port 80, the first has precedence

A cóż to oznacza? Pierwsza sekcja vHosta została potraktowana jako główna/domyślna, a każda następna po niej w jakiś niezrozumiały dla mnie sposób wchodzi w konflikt z tę pierwszą. Rezultatem tego jest, iż wywołując URL konfliktowego hosta (”elsedomain.com”, “otherdomain.com”) w przeglądarce internetowej, otrzymuję treść strony głównej hosta pierwszego, głównego (”somedomain.com”). Tego oczywiście nie chcemy.

Mam nadzieję, iż problem jest zrozumiały. Poniżej przykłady zmian, które nie przyniosły żadnej poprawy:
* zmiana dyrektyvy vHosta na:

   <virtualhost *:*>
      [...]
   </virtualhost>

* zmiana dyrektyvy vHosta na:

   <virtualhost 127.0.0.1:*>
      [...]
   </virtualhost>

* zmiana dyrektyvy vHosta na:

   <virtualhost 127.0.0.1:80>
      [...]
   </virtualhost>

* zmiana adresu IP in /etc/hosts na 127.0.0.2 oraz dyrektywy vHosta na:

   <virtualhost 127.0.0.2:80>
      [...]
   </virtualhost>

To co naprawdę pomogło, znajdywało się głównie w innym miejscu. Otóż dodałem nową linię na samym początku mego pliku vhosts.conf:

      NameVirtualHost 127.0.0.1

oraz zmodyfikowałem sekcje vHostów w taki oto sposób :

   <virtualhost 127.0.0.1:80>
      [...]
   </virtualhost>

Mimo iż jasne dla mnie było, że dyrektywa “NameVirtualHost” powinna się znajdywać w konfiguracji serwera Apache, było bardzo niełatwo wpaść na to, że to właśnie jej brakuje. Wciąż mnie zastanawia, czy jest to brak występujący tylko w dystrybucji SUSE10.2, czy może standardowo w Apache 2 nie ma jej. Z kolei zmiana znaku “gwiazdki” (*) na IP localhosta (127.0.0.1) była rzeczą oczywistą.

Jeśli więc napotkasz problem z ostrzeżeniem takim jak wyżej, mam nadzieję iż moja metoda okaże się pomocna.

Pozdrawiam



VirtualHosts nightmare on SUSE

Opublikowane jako: Apache — Tags: , — Kubek Bartosz @ 23:36

I’d like to share with time consuming problem I had last days with vHosts on Apache2 on openSuse linux. Maybe my solution will be helpful for someone, cause believe me, it’s was not easy to find solution (especially using “tries and faults” method).

So my point was to create and successful run few vHosts on my newly settled up Apache2 server. So I’ve created this vHost directives in /etc/apache2/vhosts.d/vhosts.conf :

   <virtualhost *:80>
      ServerAdmin webmaster@somedomain.com
      DocumentRoot /srv/www/somedomain
      ServerName www.somedomain.com
      ServerAlias somedomain.com
   </virtualhost>
   <virtualhost *:80>
      ServerAdmin webmaster@elsedomain.com
      DocumentRoot /srv/www/elsedomain
      ServerName www.elsedomain.com
      ServerAlias elsedomain.com
   </virtualhost>
   <virtualhost *:80>
      ServerAdmin webmaster@otherdomain.com
      DocumentRoot /srv/www/otherdomain
      ServerName www.otherdomain.com
      ServerAlias otherdomain.com
   </virtualhost>

After this, I had to also put new statements into /etc/hosts :

   127.0.0.1     www.somedomain.com
   127.0.0.1     somedomain.com
   127.0.0.1     www.elsedomain.com
   127.0.0.1     elsedomain.com
   127.0.0.1     www.otherdomain.com
   127.0.0.1     otherdomain.com

That’s all. Then I’ve restart apache service, by:

   apache2ctl restart

and here’s the result (and the problem itself) :

   [Wed Jul 25 21:42:59 2007]
      [warn] _default_ VirtualHost overlap on port 80, the first has precedence

What does it mean? The first vHost directive was treat as default one, and somehow every second vHost directive was in conflict with the default one. The The result of this conflict was, that after calling conflicted (means not the default ones) host name URL in browser (”elsedomain.com”, “otherdomain.com”) I got the content (main page) of the default host: “somedomain.com”.

So I hope the problem is clear. And here is what also didn’t work out:
* changing vHosts directive to:

   <virtualhost *:*>
      [...]
   </virtualhost>

* changing vHosts directive to:

   <virtualhost 127.0.0.1:*>
      [...]
   </virtualhost>

* changing vHosts directive to:

   <virtualhost 127.0.0.1:80>
      [...]
   </virtualhost>

* changing IP address in /etc/hosts to 127.0.0.2 and vHosts directive to:

   <virtualhost 127.0.0.2:80>
      [...]
   </virtualhost>

What does really help was something else. I’ve to add new line in the top of my vhosts.conf file:

      NameVirtualHost 127.0.0.1

and modify all vHosts sections this way:

   <virtualhost 127.0.0.1:80>
      [...]
   </virtualhost>

It was clear for me that “NameVirtualHost” should be there somewhere. Nevertheless, was very hard to find out that for default in Apache2 (or at least in his SUSE10.2 distribution) this directive is gone for default. Changing ‘*’ mark to localhost IP address (127.0.0.1) goes without saying.

So if You have problem with this warning above I’ve notice, my method should be helpful for You.

Greets



Oparte na WordPress