Wildfly, faka le seva yesicelo seJava EE ku-Ubuntu

malunga ne-wiildfly

Kwinqaku elilandelayo siza kujonga kwi-WildFly (eyayisaziwa ngokuba yiJboss AS). Oku yi ilula, ikhawuleza kwaye ilungiselelwe kakhulu iseva yesicelo seJava EE esekwe kwiJava Apho kungasetyenziswa khona izicelo ezinkulu ukusuka kwi-IDE enye. Kule mizila elandelayo siza kubona indlela yokuyifaka kwi-Ubuntu 18.04.

I-WildFly liqonga elinqamlezileyo. Inika ipaneli yokulawula eyomeleleyo eyenza Ukutshintsha ubumbeko kwiserver yesicelo kulula kakhulu kwaye kuyakhawuleza. Akunyanzelekanga ukuba ujonge emaphepheni ngokungeyomfuneko ukulungiselela imeko-bume ekhangela efanelekileyo iimfuno zakho.

Faka i-OpenJDK

uphawu lweJava
Inqaku elidibeneyo:
Faka iJava 8, 9 kunye ne-10 kwi-Ubuntu 18.04 kunye neziphumo

I-WildFly ibhaliwe kwiJava, yiyo loo nto Ifuna ukuba iJava JDK isebenze. Ukuhlangabezana nale mfuno, abasebenzisi banokukhetha ukufaka i-Oracle esemthethweni yeJava JDK okanye basebenzise enye indawo evulekileyo ebizwa ngokuba yi-OpenJDK. Kulo mzekelo, siza kukhetha uhlobo oluvulekileyo lweJava, ke kwisiphelo sendlela (Ctrl + Alt + T) siza kubhala:

ufakelo lweJava jdk

sudo apt update; sudo apt install default-jdk

Emva kokufaka i-OpenJDK, sinako jonga ufakelo Ukuchwetheza kwisiphelo sendlela:

jonga ukufakwa kweJava

java -version

Ukuba i-terminal ibuyisa eminye imigca efana naleyo ikwikrini yangaphambili, iJava iya kufakwa kwaye ilungile.

Misela umsebenzisi weWildFly

Kuba le iseva yesicelo, ngokubanzi kuyacetyiswa ukuba kusetyenziswe iakhawunti yenkonzo ezinikezelweyo. Qalisa kwisiphelo sendlela (Ctrl + Alt + T) le miyalelo ilandelayo yokwenza iakhawunti yeWildFly yokulawula iserver:

sudo groupadd -r wildfly

sudo useradd -r -g wildfly -d /opt/wildfly -s /sbin/nologin wildfly

Ukugqitywa, siyaqhubeka nokukhuphela kunye nokufakwa kweWildFly.

Khuphela kwaye ufake iWildFly

Nje ukuba ukufakwa kweJava JDK kugqityiwe kwaye ukwenziwa kweakhawunti yenkonzo yeWildFly igqityiwe, siya kwenza le miyalelo ilandelayo khuphela iphakheji yeWildFly. Okwangoku, Inguqulelo yangoku yi-16.0.0. Inguqulelo yamvanje ekhoyo inokubonwa kwi-yakho iphepha lokukhuphela.

Ukuba sivula i-terminal (Ctrl + Alt + T), sinako Sebenzisa umyalelo wget ukukhuphela iphakheji usebenzisa ngokulula le miyalelo ilandelayo:

khuphela iWildfly

cd /tmp

wget https://download.jboss.org/wildfly/16.0.0.Final/wildfly-16.0.0.Final.tar.gz

Nje ukuba ukhuphelo lugqityiwe, kuya kufuneka siphumeze le miyalelo ilandelayo yenza ifolda yeWildFly kulawulo / opt kunye nokutshintsha ubunini bakho kwiakhawunti yeWildFly.

tar xvf wildfly-16.0.0.Final.tar.gz

sudo mv wildfly-16.0.0.Final/ /opt/wildfly

sudo chown -RH wildfly: /opt/wildfly

Siyaqhubeka nokudala incwadi eneenkcukacha yeWildFly kulawulo / njl / ngalo myalelo ulandelayo:

sudo mkdir -p /etc/wildfly

Emva kokwenza umkhombandlela, kopisha iifayile zoqwalaselo zeWildFly kunye nokuphunyezwa kulawulo esandula ukwenziwa.

Khuphela iifayile zoqwalaselo kule seva yemidiya

sudo cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.conf /etc/wildfly/
sudo cp /opt/wildfly/docs/contrib/scripts/systemd/launch.sh /opt/wildfly/bin/

Kufuneka nathi yenza izikripthi kulawulo / njl / i-wildfly / ibin ziyaqhutywa.

sudo sh -c 'chmod +x /opt/wildfly/bin/*.sh'

Okwangoku siza kuthi ikopi yenkqubo efakwe kulawulo / njl / inkqubo / inkqubo / ukubaleka:

sudo cp /opt/wildfly/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system/

Ngoku sinako Sebenzisa le miyalelo ilandelayo ukumisa, ukuqala kunye nokwenza iinkonzo zeWildFly ukuqala ngokuzenzekelayo ngexesha lokuqalisa:

imiyalelo kwinkonzo yeWildfly

Okokuqala siyeke inkonzo:

sudo systemctl stop wildfly.service

Ngoku siqala inkonzo:

sudo systemctl start wildfly.service

Kwaye sagqiba ukwenza inkonzo isebenze:

sudo systemctl enable wildfly.service

ukuba qinisekisa ukuqala, sebenzisa lo mthetho ulandelayo:

ubume benkonzo

sudo systemctl status wildfly.service

Iakhawunti yomsebenzisi ukunxibelelana nokulawula iserver yewebhu

Ngoku ukuba ukhuphele kwaye ufake inkonzo yeWildFly, sebenzisa lo mthetho ulandelayo yenza iakhawunti yomsebenzisi. Oku kuyakuqhagamshela kwaye kulawule ikhonkco lewebhu kwiserver yesicelo. Siza kwenza iakhawunti ngokuchwetheza kwisiphelo sendlela (Ctrl + Alt + T):

sudo /opt/wildfly/bin/add-user.sh

Kwimenyu enokubonakala kwisikrini, thayipha "a”Kwaye ucofe u-Enter:

yenza iakhawunti yomsebenzisi kwiWildfly

Ngoku ngenisa igama lomsebenzisi elitsha kwaye wenze igama lokugqitha:

igama lomsebenzisi kunye negama lokugqitha kwiakhawunti yenkonzo

Kubhala "ewe"ye ukugqiba ngokupheleleyo. Ngoku iWildFly kufuneka ifakwe kwaye ilungile.

Wildfly kwisikhangeli

Ngoku singavula isikhangeli kwaye njenge-URL isebenzisa igama lenginginya okanye idilesi ye-IP yeseva elandelwa lizibuko 8080.

Iscreen seWildfly

http://localhost:8080

Ikhonsoli yeserver ithintelwe kwiserver yendawo kuphela. Ukuba unomdla wokudibanisa kwindawo ekude, ulwazi malunga nendlela yokwenza oko lunokufumaneka maxwebhu.

Ikhonkco lolawulo lweWildfly kwisikhangeli

Emva koku sinokufikelela kwikhonsoli yolawulo ukusuka http://localhost:9990/console ukude ngoko I-WildFly ifakwe ngempumelelo kwi-Ubuntu, 18.04 kule meko.


Umxholo wenqaku uyabambelela kwimigaqo yethu imigaqo yokuziphatha yokuhlela. Ukuxela impazamo cofa apha.

Izimvo ezi-2, shiya ezakho

Shiya uluvo lwakho

Idilesi yakho ye email aziyi kupapashwa.

*

*

  1. Uxanduva lwedatha: UMiguel Ángel Gatón
  2. Injongo yedatha: Ulawulo lwe-SPAM, ulawulo lwezimvo.
  3. Umthetho: Imvume yakho
  4. Unxibelelwano lwedatha: Idatha ayizukuhanjiswa kubantu besithathu ngaphandle koxanduva lomthetho.
  5. Ukugcinwa kweenkcukacha
  6. Amalungelo: Ngalo naliphi na ixesha unganciphisa, uphinde uphinde ucime ulwazi lwakho.

  1.   UEliana sitsho

    Enkosi, kuphela kwesifundo esisebenzayo 🙂

  2.   UFernando sitsho

    Imnandi. Yabusindisa ubomi bam.