البرمجة

كيفية تكوين IIS 7 لموقع ويب localhost

To configure IIS 7 to run your ASP.NET application on localhost without Visual Studio, follow these steps:

  1. Publish your ASP.NET application: First, you need to publish your ASP.NET application from Visual Studio. Right-click on your project in Visual Studio, select “Publish,” and follow the wizard to publish your application to a folder on your computer.

  2. Create a new site in IIS: Open Internet Information Services (IIS) Manager. Right-click on “Sites” in the Connections pane and select “Add Website.” Enter a name for your site, select the physical path to the published folder from step 1, and set the binding to “http” and “localhost” with a port number (e.g., 80 or 8080).

  3. Configure the application pool: Select the application pool for your new site (or create a new one if needed). Make sure the .NET CLR version matches your application’s requirements (e.g., v4.0). Also, ensure the Managed pipeline mode is set to “Integrated.”

  4. Set permissions: Ensure the IIS_IUSRS group has read and execute permissions on the published folder. Right-click on the folder, select “Properties,” go to the “Security” tab, and add the IIS_IUSRS group with the required permissions if it’s not already there.

  5. Access your site: Open a web browser and navigate to http://localhost:/, replacing with the port number you configured in step 2. Your ASP.NET application should now be running on localhost through IIS 7 without Visual Studio.

بعد تحميل وتثبيت المكونات اللازمة، يمكنك البدء في عمل تطبيقات ASP.NET على جهاز الكمبيوتر الخاص بك باستخدام IIS 7.

المزيد من المعلومات

بالتأكيد، إليك بعض المعلومات الإضافية حول تكوين IIS 7 لتشغيل موقع الويب على الخادم المحلي (localhost):

  1. تحديد مسار الويب الافتراضي: يمكنك تحديد مسار الويب الافتراضي لموقعك الجديد في IIS. انقر بزر الماوس الأيمن فوق موقع الويب الخاص بك في IIS Manager واختر “Basic Settings”. في النافذة التي تظهر، يمكنك تحديد المجلد الذي تريد استخدامه كمسار الويب الافتراضي.

  2. تكوين مضيفات النظام الأساسي (Hosts): لتحديد اسم المضيف لموقعك الجديد (مثل http://mywebsite.local) بدلاً من استخدام localhost, يمكنك تعديل ملف hosts على جهاز الكمبيوتر الخاص بك. يقع هذا الملف في C:\Windows\System32\drivers\etc على نظام التشغيل Windows. يجب عليك إضافة إدخال مثل 127.0.0.1 mywebsite.local إلى هذا الملف.

  3. تكوين الحماية: يمكنك تكوين الحماية لموقع الويب الخاص بك في IIS. يمكنك تحديد أذونات الوصول وتكوين إعدادات SSL إذا كنت ترغب في تشفير اتصالاتك.

  4. إعادة تشغيل خدمة IIS: في بعض الأحيان، يمكن أن تحتاج إلى إعادة تشغيل خدمة IIS لتطبيق التغييرات التي قمت بها. يمكنك فعل ذلك عن طريق الذهاب إلى “Services” في نظام التشغيل Windows، ابحث عن “World Wide Web Publishing Service”، ثم انقر بزر الماوس الأيمن واختر “Restart”.

بعد اتباع هذه الخطوات، يجب أن يكون بإمكانك تشغيل تطبيق ASP.NET الخاص بك على الخادم المحلي (localhost) بشكل صحيح ودون الحاجة إلى استخدام Visual Studio.

زر الذهاب إلى الأعلى