Mở file cert.conf và thay đổi {{DOMAIN}} thành tên miền bạn muốn, trong trường hợp này site.test và lưu lại.
Nhấp đúp chuột vào make-cert.bat và nhập tên miền site.test khi được nhắc. Và nhập trả lời cho các câu hỏi khác, thiết lập mặc định có sẵn trong cert.conf
huong-dan-cau-hinh-ssl-tren-localhost-cho-xampp-1
5. CÀI ĐẶT CHỨNG CHỈ TRONG WINDOWS.
Sau đó, bạn sẽ thấy thư mục site.test được tạo. Trong thư mục đó ta sẽ có server.crt and server.key. Đây là chứng chỉ SSL certificate.
Nhấp đúp chuột vào server.crt để cài đặt nó trên Windows để Windows chấp nhận chứng chỉ này.
Và chọn Local Machine trong Store Location.
Tiếp tục chọn “Place all certificate in the following store” và click browse sau đó chọn Trusted Root Certification Authorities.
Chọn Next và Finish.
Và bây giờ chứng chỉ này đã được cài đặt là tin cậy (trusted) trong Windows. Tiếp theo là làm thế nào để sử dụng chứng chỉ này trong XAMPP.
6. THÊM TRANG WEB TRONG MÁY CHỦ WINDOWS
Mở notepad với quyền administrator.
Sửa C:\Windows\System32\drivers\etc\hosts
Thêm một dòng mới:
Điều này sẽ giúp XAMPP khi truy cập http://site.test sẽ trỏ tên miền này về IP localhost
7. THÊM TÊN MIỀN NÀY VÀO FILE CONF CỦA XAMPP.
Giờ bạn cần kích hoạt SSL cho tên miền này và cho XAMPP biết nơi lưu trữ Chứng chỉ SSL. Vì vậy, bạn cần chỉnh sửa C:\xampp\apache\conf\extra\httpd-xampp.conf
Và thêm dòng mới này dưới cùng:
Sau đó, bạn sẽ cần khởi động lại Apache trong XAMPP. Đơn giản, chỉ cần mở Bảng điều khiển XAMPP và bấm stop và start tại mục Apache.
Mẹo: Trong file conf XAMPP, bạn có thể thay đổi thư mục gốc cho từng tên miền nếu cần.
8. KHỞI ĐỘNG LẠI TRÌNH DUYỆT VÀ THỬ LẠI!
Cần khởi động lại trình duyệt để hệ thống tải chứng chỉ. Và truy cập tên miền trên trình duyệt của bạn, và bạn sẽ thấy khóa màu xanh lá như hình bên dưới!
Ngôi Sao Số hy vọng hướng dẫn này hữu ích!
9. Setting a Local Development Environment for Laravel on Windows | Install Laravel on Windows
Setting a Local Development Environment for Laravel on Windows | Install Laravel on Windows
Many developers use Windows for PHP projects, we will cover a basic XAMPP Setup for a Laravel project. Following these easy steps will help you run your PHP projects and install Laravel on Windows in a matter of minutes.
Installing XAMPP for Laravel
Download XAMPP for Windows from their official site: https://www.apachefriends.org/download.html
For our example, we’ve chosen PHP 7.1 and XAMPP 32 bit
Run the installer and select Apache, MySQL and phpMyAdmin
It’s recommended to make the installation in C:\ to avoid issues with Windows User permissions (or the drive where your Windows is installed)
After it’s complete do not start anything just yet.
Setting PHP from Windows CMD
Open Advanced System Settings (System Properties -> Advanced)
Open Environment Variables
On the top window select Path and click on Edit
In the new window click on New
We need to enter the path to XAMPP’s PHP
We will also add MySQL’s Path, click on New again and enter
Composer from Windows CMD
Download Composer’s Windows .exe installer: https://getcomposer.org/download/
Place the installer and run it from the added to Path directory – C:\xampp\php
Now that we have Apache, PHP, MySQL and Composer installed, we’re ready to install Laravel, set a Virtual Host with a custom domain for local development. XAMPP’s Apache uses the htdocs folder for serving HTTP requests, we’ll set our custom Laravel Virtual Host under C:\xampp\htdocs\example\ which will be opened locally from example.com
Install Laravel on Windows with Composer
Open Window’s CMD or PowerShell
Install Laravel using Composer
Creating MySQL Database for Laravel
Open the CMD or PowerShell again
Access the MySQL CLI
Create Database for Laravel
Setting Laravel’s .env file
Navigate to C:\xampp\htdocs\example
Open the config/database.php file and edit the MySQL Connection settings
Virtual Host with XAMPP
Navigate to C:\xampp\apache\conf\extra
Open httpd-vhosts.conf and append:
Enable mod_rewrite for Laravel
Open the httpd.conf file in C:\xampp\apache\conf\extra
Look for LoadModule rewrite_module modules/mod_rewrite.so and remove the ; at the start
Setting local domain with hosts file
Navigate to c:\Windows\System32\Drivers\etc
Open the hosts file with Administrator Privileges
Append the line at the bottom
Start Apache and MySQL, your local Laravel project will be opened from example.com and you’re ready to start working on it. When ready you can contact us to have it deployed on a WebHostFace server
You can benefit from a fast and reliable SSD Laravel Hosting with our shared hosting services. Now with a greatly discounted price! Start your new Laravel project on a professionally set hosting environment without investing a large amount of money and grow your online presence!
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the installation.
* You don't have to use the website, you can copy this file to "wp-config.php"
* and fill in the values.
*
* This file contains the following configurations:
*
* * Database settings
* * Secret keys
* * Database table prefix
* * ABSPATH
*
* @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/
*
* @package WordPress
*/
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wp1' );
/** Database username */
define( 'DB_USER', 'root' );
/** Database password */
define( 'DB_PASSWORD', '' );
/** Database hostname */
define( 'DB_HOST', 'localhost' );
/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );
/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );
/**#@+
* Authentication unique keys and salts.
*
* Change these to different unique phrases! You can generate these using
* the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
*
* You can change these at any point in time to invalidate all existing cookies.
* This will force all users to have to log in again.
*
* @since 2.6.0
*/
define( 'AUTH_KEY', '!b>mMQ90aj-pu0.:3k:6d}),^*!A!Q[@qB:Dboci +mG]a:=c(BIZ{B/0OFd(`J=' );
define( 'SECURE_AUTH_KEY', 'Y2yho<.qJz`+:%!al+JG=s`vd=uH5,8i|f>#@.xI_,;< Vr[>dah_:Jk@?{Lvw]!' );
define( 'LOGGED_IN_KEY', '*opK(8 ZDVK5^EVMiTGy$@5K6>>0`&u0j4JbTFJYx`7D)gg-3/zo^>I!^HGy)R}=' );
define( 'NONCE_KEY', '4*U0[s$#ot8U0] s^6n7(M-MnLv.sI`j$cF3^GZ1PWZn[tUrvf~&gTV*{hOl8EPU' );
define( 'AUTH_SALT', '6^<m$~{QDVAU*cn4/sC#B4;cMa{EUpN4W.9GNVJA+W_A|lC)I/`.4;xM>jHKOKw#' );
define( 'SECURE_AUTH_SALT', '3K^4%x_}#ob5zB.^^>0~R{y>$,%Xkyd{a>k#(|Ax.]d-:BJ3Iu-KHk>@xt}r:l7a' );
define( 'LOGGED_IN_SALT', 'IA;@LY%o2a:Z+{J{jsD@_2xtkh,37Hl4eO0,NIl8v6aXy+`5_(OpPo)3.tFfz}CA' );
define( 'NONCE_SALT', 'YtvbrnrY9pS9z`_nJ~u#K8Q0 _ZaQ3!X$q90O<-fNPN].aGV-PhH4}(J/*]U1z6X' );
/**#@-*/
/**
* WordPress database table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*
* At the installation time, database tables are created with the specified prefix.
* Changing this value after WordPress is installed will make your site think
* it has not been installed.
*
* @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/#table-prefix
*/
$table_prefix = 'wp_';
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the documentation.
*
* @link https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/
*/
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
define( 'DOMAIN_CURRENT_SITE', 'wp1.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
// define( 'WP_DEBUG', true );
// define( 'WP_DEBUG_DISPLAY', true );
// @ini_set( 'display_errors', 1 );
/* Add any custom values between this line and the "stop editing" line. */
/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
# <IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# RewriteBase /
# RewriteRule ^index\.php$ - [L]
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule . /index.php [L]
# </IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress
<VirtualHost *:443>
ServerName wp1.com
ServerAlias *.wp1.com
DocumentRoot "C:/xampp82/htdocs/wp1"
SSLEngine on
SSLCertificateFile "conf/mwp1/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/mwp1/ssl.key/server.key"
<Directory "C:/xampp82/htdocs/s1wp1">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>