Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Ad icon
Gampaha
Thenya Mishel
menuka2000
Updated:
Wednesday at 10:48 PM
Handmade Character Soft Toy Bluey Bingo
anil1961
Updated:
Aug 3, 2026
Colombo
Dahua POE Switch 8 Ports (DH-PFS3010-8ET-65)
hashaz2012
Updated:
Aug 3, 2026
Ad icon
Singapore V2Ray VPN for Tunneling
hu KANNA
Updated:
Jul 31, 2026
Dating Website & Online Chat Room
hotvideo
Updated:
Jul 30, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
Computers & Internet
Tips & Tricks
Localhost directory එක වෙනස් කරන්නේ කොහොමද ? - Linux
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="dhanush_c" data-source="post: 18627460" data-attributes="member: 530786"><p><strong>Localhost directory එක වෙනස් කරන්නේ කොහොමද ? - Linux</strong></p><p></p><p>කලින් mysql, apache install කරන පොස්ට් එකේ කියලා තියන විදියට apache server එක install කරාට පස්සේ test කරලා බලන්න පුළුවන් browser url එකේ localhost කියලා type කරලා. එත් localhost directory එක විදියට default තියෙන්නේ /var/www/html/ directory එක.</p><p></p><p><img src="https://dhanushkablog.files.wordpress.com/2015/07/term.png?w=584&h=376" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>මෙතැනදී browser එකෙන් localhost එකට ගියොත් තියෙන්නේ මේ වගේ එකක්.</p><p></p><p><img src="https://dhanushkablog.files.wordpress.com/2015/07/apache2-localhost.png?w=584&h=348" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>මේක වෙන්නේ localhost directory එකේ තියන index.html එක view වෙන නිසා.</p><p></p><p>එත් development වලදී අපි වෙන wenama folder use කරන්නේ. මේ නිසා /var/www/html/ කියන එක /var/www/ වලට වෙනස් කරගන්න ඕන. මේක කරන්නේ කොහොමද කියලා තමයි මේ පොස්ට් එකේ විස්තර කරන්නේ.</p><p></p><p>මුලින්ම terminal එකෙන් apache folder එකට යන්න ඕන.</p><p></p><p>[CODE][B][SIZE=5]cd /etc/apache2/sites-enabled[/SIZE][/B][/CODE]<img src="https://dhanushkablog.files.wordpress.com/2015/07/term2.png?w=584&h=372" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>මේකේ තියනවා 000-default.conf කියලා file එකක්. ls command එකෙන් බලන්න පුළුවන්නේ folder එකේ content එක.</p><p></p><p></p><p><img src="https://dhanushkablog.files.wordpress.com/2015/07/term21.png?w=584&h=378" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>දැන් root privileges අරගන්න ඕන terminal එකෙන්.</p><p></p><p>[CODE][B][SIZE=5]sudo su[/SIZE][/B][/CODE]</p><p>දැන් password එක අහයි. ඒක දෙන්න. දැන් root එකෙන් ලොග් වෙලා ඉන්නේ. root එකෙන් කිව්වම දන්නවනේ කැමති ඕන දෙයක් හෙවිල්ලක් බැලිල්ලක් නැතුව කරලා දාන්න පුළුවන් කියලා. මේ කරන්න හදන්නෙත් ඒ වගේ වැඩක්.</p><p></p><p><img src="https://dhanushkablog.files.wordpress.com/2015/07/term22.png?w=584&h=382" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>දැන් මේ file එකේ permission වෙනස් කරන්න හදන්නේ. එතකොට normal account එකෙන් උනත් edit කරන්න පුළුවන්. නැත්තන් ඉතින් linux යකා මේ වැඩ වලට අවසර දෙන්නේ නෑනේ.</p><p></p><p>[CODE][B][SIZE=5]chmod 755 000-default.conf[/SIZE][/B][/CODE]file permission ගැන සේරම දේවල් වෙන පොස්ට් එකකින් කියන්නම්. දැනට මේකෙන් වැඩේ කරගමු. <img src="/styles/default/xenforo/smilies/default/happy.gif" class="smilie" loading="lazy" alt=":)" title="Happy :)" data-shortname=":)" /></p><p></p><p><img src="https://dhanushkablog.files.wordpress.com/2015/07/term23.png?w=584&h=375" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>දැන් කරන්න තියෙන්නේ file එක open කරන එක. ඒක terminal එකේ ඉදගෙනම කරන්න පුළුවන් මෙහෙම.</p><p></p><p>[CODE][SIZE=5][B]nano 000-default.conf[/B][/SIZE][/CODE]root එකේම ඉන්නවා නම් මේක ගහන්න, නැත්තන් ඉස්සරහට sudo කියලා දාගන්න.</p><p></p><p><img src="https://dhanushkablog.files.wordpress.com/2015/07/term24.png?w=584&h=373" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>මේ file එකේ තියනවා DocumentRoot කියලා එකක්. මෙතන තමයි ඒ directory එකේ ලියලා තියෙන්නේ. මෙතෙන්ට කැමති directory එකක් දුන්නම ඒක තමයි localhost එක වෙන්නේ. මම දිගටම මේ directory එකම use කරනවා අන්තිමට තියන html එක අයින් කරලා.</p><p></p><p><img src="https://dhanushkablog.files.wordpress.com/2015/07/term25.png?w=584&h=374" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p><strong>/var/www </strong>කියන directory එක තමයි මගේ localhost එක දැන්.</p><p></p><p><img src="https://dhanushkablog.files.wordpress.com/2015/07/term26.png?w=584&h=373" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>දැන් ctrl + x වලින් exit වෙන්න හදද්දී අහනවා changes save කරන්නද කියලා. එකට y දීලා දෙපාරක් enter press කරන්න. ඊටපස්සේ apache server එක restart කරගන්න ඕන.</p><p></p><p>[CODE][B][SIZE=5]sudo service apache2 restart[/SIZE][/B][/CODE]<img src="https://dhanushkablog.files.wordpress.com/2015/07/term27.png?w=584&h=373" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>දැන් browser එකෙන් localhost එකට ගියාම තියෙන්නේ මේ වගේ එකක්. server එකට add කරන web sites/ applications වල folders මෙතන display වෙනවා. folder එක click කරලා run කරන්න පුළුවන් මෙතන ඉඳන්.</p><p></p><p><img src="https://dhanushkablog.files.wordpress.com/2015/07/term28.png?w=584&h=186" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>දැන් වැඩේ ඉවරෙටම ඉවරයි... <img src="/styles/default/xenforo/smilies/default/P.gif" class="smilie" loading="lazy" alt=":P" title=":P :P" data-shortname=":P" /></p><p></p><p></p><p><em>Linux is a cancer that attaches itself in an intellectual property sense to everything it touches. – Steve Ballmer</em></p><p> </p><p></p><p>FOSS වලට ජයවේවා !!</p><p></p><p><a href="https://dhanushkablog.wordpress.com/2015/07/07/how-to-change-localhost-directory-ubuntu/" target="_blank">https://dhanushkablog.wordpress.com/2015/07/07/how-to-change-localhost-directory-ubuntu/</a></p></blockquote><p></p>
[QUOTE="dhanush_c, post: 18627460, member: 530786"] [b]Localhost directory එක වෙනස් කරන්නේ කොහොමද ? - Linux[/b] කලින් mysql, apache install කරන පොස්ට් එකේ කියලා තියන විදියට apache server එක install කරාට පස්සේ test කරලා බලන්න පුළුවන් browser url එකේ localhost කියලා type කරලා. එත් localhost directory එක විදියට default තියෙන්නේ /var/www/html/ directory එක. [IMG]https://dhanushkablog.files.wordpress.com/2015/07/term.png?w=584&h=376[/IMG] මෙතැනදී browser එකෙන් localhost එකට ගියොත් තියෙන්නේ මේ වගේ එකක්. [IMG]https://dhanushkablog.files.wordpress.com/2015/07/apache2-localhost.png?w=584&h=348[/IMG] මේක වෙන්නේ localhost directory එකේ තියන index.html එක view වෙන නිසා. එත් development වලදී අපි වෙන wenama folder use කරන්නේ. මේ නිසා /var/www/html/ කියන එක /var/www/ වලට වෙනස් කරගන්න ඕන. මේක කරන්නේ කොහොමද කියලා තමයි මේ පොස්ට් එකේ විස්තර කරන්නේ. මුලින්ම terminal එකෙන් apache folder එකට යන්න ඕන. [CODE][B][SIZE=5]cd /etc/apache2/sites-enabled[/SIZE][/B][/CODE][IMG]https://dhanushkablog.files.wordpress.com/2015/07/term2.png?w=584&h=372[/IMG] මේකේ තියනවා 000-default.conf කියලා file එකක්. ls command එකෙන් බලන්න පුළුවන්නේ folder එකේ content එක. [IMG]https://dhanushkablog.files.wordpress.com/2015/07/term21.png?w=584&h=378[/IMG] දැන් root privileges අරගන්න ඕන terminal එකෙන්. [CODE][B][SIZE=5]sudo su[/SIZE][/B][/CODE] දැන් password එක අහයි. ඒක දෙන්න. දැන් root එකෙන් ලොග් වෙලා ඉන්නේ. root එකෙන් කිව්වම දන්නවනේ කැමති ඕන දෙයක් හෙවිල්ලක් බැලිල්ලක් නැතුව කරලා දාන්න පුළුවන් කියලා. මේ කරන්න හදන්නෙත් ඒ වගේ වැඩක්. [IMG]https://dhanushkablog.files.wordpress.com/2015/07/term22.png?w=584&h=382[/IMG] දැන් මේ file එකේ permission වෙනස් කරන්න හදන්නේ. එතකොට normal account එකෙන් උනත් edit කරන්න පුළුවන්. නැත්තන් ඉතින් linux යකා මේ වැඩ වලට අවසර දෙන්නේ නෑනේ. [CODE][B][SIZE=5]chmod 755 000-default.conf[/SIZE][/B][/CODE]file permission ගැන සේරම දේවල් වෙන පොස්ට් එකකින් කියන්නම්. දැනට මේකෙන් වැඩේ කරගමු. :) [IMG]https://dhanushkablog.files.wordpress.com/2015/07/term23.png?w=584&h=375[/IMG] දැන් කරන්න තියෙන්නේ file එක open කරන එක. ඒක terminal එකේ ඉදගෙනම කරන්න පුළුවන් මෙහෙම. [CODE][SIZE=5][B]nano 000-default.conf[/B][/SIZE][/CODE]root එකේම ඉන්නවා නම් මේක ගහන්න, නැත්තන් ඉස්සරහට sudo කියලා දාගන්න. [IMG]https://dhanushkablog.files.wordpress.com/2015/07/term24.png?w=584&h=373[/IMG] මේ file එකේ තියනවා DocumentRoot කියලා එකක්. මෙතන තමයි ඒ directory එකේ ලියලා තියෙන්නේ. මෙතෙන්ට කැමති directory එකක් දුන්නම ඒක තමයි localhost එක වෙන්නේ. මම දිගටම මේ directory එකම use කරනවා අන්තිමට තියන html එක අයින් කරලා. [IMG]https://dhanushkablog.files.wordpress.com/2015/07/term25.png?w=584&h=374[/IMG] [B]/var/www [/B]කියන directory එක තමයි මගේ localhost එක දැන්. [IMG]https://dhanushkablog.files.wordpress.com/2015/07/term26.png?w=584&h=373[/IMG] දැන් ctrl + x වලින් exit වෙන්න හදද්දී අහනවා changes save කරන්නද කියලා. එකට y දීලා දෙපාරක් enter press කරන්න. ඊටපස්සේ apache server එක restart කරගන්න ඕන. [CODE][B][SIZE=5]sudo service apache2 restart[/SIZE][/B][/CODE][IMG]https://dhanushkablog.files.wordpress.com/2015/07/term27.png?w=584&h=373[/IMG] දැන් browser එකෙන් localhost එකට ගියාම තියෙන්නේ මේ වගේ එකක්. server එකට add කරන web sites/ applications වල folders මෙතන display වෙනවා. folder එක click කරලා run කරන්න පුළුවන් මෙතන ඉඳන්. [IMG]https://dhanushkablog.files.wordpress.com/2015/07/term28.png?w=584&h=186[/IMG] දැන් වැඩේ ඉවරෙටම ඉවරයි... :P [I]Linux is a cancer that attaches itself in an intellectual property sense to everything it touches. – Steve Ballmer[/I] FOSS වලට ජයවේවා !! [URL]https://dhanushkablog.wordpress.com/2015/07/07/how-to-change-localhost-directory-ubuntu/[/URL] [/QUOTE]
Insert quotes…
Verification
Hata thunen beduwama keeyada? (60 bedeema thuna)
Post reply
Top
Bottom