المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : لينكس setting up a local server, how to?



Abo_mariam
10-03-2005, 11:27 AM
Alsalam Alykom.
First,thanks for reading.

ok, here it is.
I was on a winmodem for some time and setting up my localhost was so easy, after installng Apache,Php and MySql...hit the page - 127.0.0.1/phpmyadmin - and it is done.

BUT, now I have a new ADSL coneection with my friends - through a lan -every thing just gone.
I did try to access my local host as i was doing befor - 127.0.0.1/phpmyadmin - and it refuses the connection.

any help .

I'm on dynamic IP not static one.

Thanks

ibn_alqalam
10-03-2005, 06:02 PM
عزيزي, هل من الممكن ان اجيبك بالعربية في المستقبل؟


You said "winmodem", so I am guessing you're still on Windows?

Either way, if you want to access your own local webserver, on the same machine that you're on RIGHT NOW, then you can do what you've always done and access http://127.0.0.1/phpmyadmin

But, if you want others to access your local webserver, then you either need to tell them your IP (if you have dynamic IP, then you will have to tell them EVERYTIME it changes!) or you will need to get a domain name, since people are better are remembering words than numbers.

Actually, I don't think I understand the setup. Do you want to access your home machine from anywhere on the internet, or do you have a real Local Area Network (LAN) that only the two of you (you and your friend) can communicate? or are you accessing the inernet through your friend's machine? or what?

It is easier if you tell me wha you _want_ as opposed to what _is_

Abo_mariam
10-03-2005, 06:43 PM
بسم الله الرحمن الرحيم
الاخ الحبيب: جزاك الله خيراً
وعذراً للكتابة بالانجليزية - يادوب لسه مركب العربى دلوقت -
على كل حال انا استخدم الآن ماندراك 10.1 وقبل الآن كنت على 9.2
من قبل كنت استعمل winmodem as a connection methode وكان كل شئ تمام
فبعد تركيب Apache , Php and MySql بمجرد نقل الPhpMyAdmin الى الروت وخلاص
كل شئ جاهز وسكربتات ال php تمام
ولكن الآن انا على Lan with Alcatel lan ADSL modem يعنى على Lan
فبعد الخطوات المعتادة فى تركيب السيرفر وقاعدة البيانات وال ب اتش ب
كل ما أحاول اوصل للphpmy admin ما فيش فايدة
فيا ترى ايه المشكلة؟ياترى أجد الـLocalhost فين؟
اتمنى ان يكون سؤالى واضحاًوعذراً مرة أخرى ان أسأت التعبير
وشكراً

ibn_alqalam
10-03-2005, 08:28 PM
login as root then type



ifconfig

or

ifconfig -a


Tell me the output of "ifconfig", it seems like your loopback device is not configured.

You don't need any internet to access a server running on your local machine; if you're sitting at the terminal and typing at the keyboard, you don't need any internet.

Abo_mariam
10-03-2005, 09:20 PM
The output of ifconfig -a is the following

eth0 Link encap:Ethernet HWaddr 00:08:C7:85:F2:E1
inet addr:10.0.0.2 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::208:c7ff:fe85:f2e1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:234208 errors:0 dropped:0 overruns:0 frame:0
TX packets:265510 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:172763475 (164.7 Mb) TX bytes:87356711 (83.3 Mb)
Interrupt:22 Base address:0x9000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:7088 errors:0 dropped:0 overruns:0 frame:0
TX packets:7088 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:448277 (437.7 Kb) TX bytes:448277 (437.7 Kb)

sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)


if you're sitting at the terminal and typing at the keyboard, you don't need any internet
I didn't understands what did you mean by that...

Actually I'm using my Linux box mainly for php scripts, to test them before I put them online.

ibn_alqalam
10-03-2005, 11:56 PM
both your network interfaces are fine.

When you try to access http://127.0.0.1/phpmyadmin, what error message does it give you? What does it say?

I am inclined to think that your apache is either not running, or maybe no listening at the default port. I just don't believe your internet connection has anything to do with accessing a webserver running on your desktop machine, you have loopback configured and up already.

ibn_alqalam
11-03-2005, 12:06 AM
try this command and see what it tells you:



hostname


It will give you name, or "localhost" a default. If it gives you a name, ping that name, else ping localhost:



ping localhost


You will need to interrupt unix ping by pressing control-C.

If that is successful, then try to see if apache is running:



ps -aux | grep -i apache

Abo_mariam
11-03-2005, 11:40 AM
Thanks a lot.
I know what I was missing.
my machine name on the Lan.but what is my IP?in this case would be - 10.0.0.2 - as the ouput of ifconfig give me?

Thanks again brother.
One more question, if is ok with you.
I want to access some other PC on my lan.I did try to make that many times using samba and they did not respond at all.so, where sould I look for this conf. problem.?

ibn_alqalam
11-03-2005, 03:52 PM
عذرا الى الاخوة القراء, اذا لا تجيد الانجليزية اخبروني و سوف اترجم لكم.



Thanks a lot.
I know what I was missing.
my machine name on the Lan.but what is my IP?in this case would be - 10.0.0.2 - as the ouput of ifconfig give me?

Thanks again brother.
One more question, if is ok with you.
I want to access some other PC on my lan.I did try to make that many times using samba and they did not respond at all.so, where sould I look for this conf. problem.?

No nonononono, SAMBA comes later!

You should first be able to ping the other machine; if it is on the same LAN, it should be something like 10.0.0.3 or something.

If you can ping the machine, then you can install and configure other higher level services/protocols.

There are three steps to making a machine LAN enabled in Unix:

1) Giving it an IP, using your networks apppropriate netmask; 255.0.0.0 in your case because you're using a class A IP. You do this with /sbin/ifconfig (I am lying, each machine can have more than one IP, it's the interfaces that can have ONLY one, for example each network card can only have one number bound to it.) The loopback IP "127.0.0.1" is usually preconfigured for you.

2) Giving the machine a name and binding that name to an IP so users can refer it by name as opposed by that cryptic dotted number. This involves editing the /etc/hosts file on all your machines and all your machines' names and their corresponding IPs. The default name is "localhost" and it's usually preconfigured for you.

3) Bringing up the appropriate services in each; the secure shell daemon sshd if you want to login to the server from others. Disable sensitive services like finger. Cleaning up your startup scripts so you don't have tons of useless daemons come up, most of them insecure or too supid to jeopordize the security of your system. Enabling the appropriate levels and verbosity of logging. Restricting remote root logins and giving partial powers to your local users (su, sudo, etc.)

That is it in a nutshell. Unix administration could be either trivial, or very involving. You can skip all those steps if you use graphical utilities that comes in most systems.

Since you can read English well, I recommend you read the following book; yes, it's the ENTIRE book with figures:

http://www.oreilly.com/catalog/linag2/book/

ibn_alqalam
11-03-2005, 04:24 PM
كدت انسى! اقراء القسم الخامس في الكتاب اللي اعطيتلك اعلاه. ماعليك فعله هو التاكد من امكانية الوصول اليه عبر الشبكة. يجب ان تنادي الجهاز الثاني باداة "ping", فان ا جاب, يمكنك ان تدخله عبر ssh او telnet.

هل كلا الجهازان يونكسان ام ان احدهما وندوز؟

معظم خدمات الشبكة في يونكس يعملن في صيغة خادم-مخدوم client/server. الخادم يوفر خدمات للشبكة و المخدوم يستهلكها. قد يوفر جهاز خدمة للشبكة, مثلا البريد الاكتروني, و يكون في دور الخادم في كل الشؤن المتعلقة بخدمته. والجهاز نفسه قد يستهلك الخدمات التي تقدمها الاجهزة الخرى, و يكون مخدوما او مستهلكا لها.

هنا بعض الخدمات الشبكية والادوات التي نستخدم لاستهلاكها:
مواقع الWWW: الخادم هو Apache او IIS او اي خادم اخر. المخدوم هو Mozilla Firefox Opera او Internet Explorer.

للدخول الى الاجهزه عن بعد remote login, يجب ان تهيئ الخادم و تستخدم الاداة الازمة لاستهلاك الخدمة. برنامج telnet احدى الادوات: telnet الى الجهاز و عرف نفسك login. معظم اللينكسات تهيء خدمة الtelnet تلقائيا.

حين تتاكد من صحة كل شيئ و الجميع يعمل على مايرام, سارع بتنصيب خدمة ال ssh, Secure Shell. تعمل كtelnet ولكنها اكثر امن.

ssh تاتي مع كل قرص linux, و اذا لا يحتويها قرصك, انزلها من هنا:

http://openssh.org/

لWindows, هناك اداة رائعة تدعى PuTTY:

http://www.chiark.greenend.org.uk/~sgtatham/putty/ (http://www.chiark.greenend.org.uk/%7Esgtatham/putty/)

واعتذر عن عربيتي عزيزي, هذا ما جنته علي الهجرة و قد كنت من افصحهم في صغري مع ان العربية ليست بلغتي الام.

Abo_mariam
11-03-2005, 07:56 PM
Well,
First of all, thanks a million and may God bless you.
I know some infos about command line - It wouldn't scare me off -
and for Arabic problem, I think when it comes to dealing with Pcs or UNIX we should make it all in English - all the resources out there is in English, and it will take a lot of time to translate them and to get the main idea out of it into Arabic, maybe some of our brothers and sisters here will not agrre with me on that.
But any way. Thanks .
btw, that oreilly book is very good to read - in all cases - newbie or a super system admin.
yours
Taher