LAMP Stack Integration Flashcards
(25 cards)
What is LAMP stack integration?
LAMP stack integration combines Linux, Apache, MySQL, and PHP to create a functional web server environment.
Integration ensures WordPress or PHP apps run smoothly by connecting components. Freelancers deploy LAMP for client sites, while enterprise architects design integrated, scalable systems, aligning with your LAMP stack goals.
How do you install Apache on a Linux server?
Use sudo apt install apache2 on Debian/Ubuntu, then start with sudo service apache2 start.
Installs Apache for WordPress in LAMP. Freelancers set up web servers, while enterprise architects automate installations, building on your Linux basics deck.
How do you install MySQL for LAMP?
Use sudo apt install mysql-server, then secure with sudo mysql_secure_installation.
Prepares MySQL for WordPress databases. Freelancers configure databases, while enterprise architects ensure secure setups, per your MySQL deck.
How do you install PHP for LAMP?
Use sudo apt install php libapache2-mod-php php-mysql, then restart Apache.
Enables PHP for WordPress. Freelancers install PHP modules, while enterprise architects select specific PHP versions (e.g., 8.1) for compatibility, per your PHP core concepts deck.
How do you verify Apache is running in LAMP?
Use sudo service apache2 status or access http://localhost to see the default page.
Confirms Apache serves WordPress files. Freelancers check server status, while enterprise architects monitor services, aligning with your Apache configuration knowledge.
How do you connect PHP to MySQL in LAMP?
Use PDO or mysqli, like $pdo = new PDO(“mysql:host=localhost;dbname=mydb”, “user”, “pass”);.
Links WordPress to its database. Freelancers configure connections, while enterprise architects optimize connection pooling, per your PHP database deck.
What is wp-config.php in WordPress LAMP integration?
wp-config.php configures WordPress’s database connection, like define(‘DB_NAME’, ‘mydb’);.
Links WordPress to MySQL in LAMP. Freelancers set credentials, while enterprise architects secure wp-config.php permissions, per your security decks.
How do you set file permissions for WordPress in LAMP?
Use sudo chmod -R 755 /var/www/html and sudo chown -R www-data:www-data /var/www/html.
Ensures Apache can access WordPress files. Freelancers secure permissions, while enterprise architects automate permission settings, per your Linux basics deck.
How do you configure Apache for WordPress permalinks?
Enable mod_rewrite with sudo a2enmod rewrite and set AllowOverride All in /etc/apache2/sites-available/000-default.conf.
Supports WordPress clean URLs. Freelancers configure .htaccess, while enterprise architects optimize rewrites, per your Apache deck.
What is the role of /var/www/html in LAMP?
/var/www/html is Apache’s default document root for serving web files.
Hosts WordPress files. Freelancers place site files here, while enterprise architects configure custom roots for multiple sites, per your Apache knowledge.
How do you test PHP in a LAMP stack?
Create a file (e.g., info.php) with <?php phpinfo(); ?> in /var/www/html and access it via a browser.
Verifies PHP integration with Apache. Freelancers confirm PHP setup, while enterprise architects check PHP modules, per your PHP core concepts deck.
How do you restart Apache in LAMP?
Use sudo service apache2 restart or sudo systemctl restart apache2.
Applies WordPress configuration changes. Freelancers restart after edits, while enterprise architects minimize downtime with reloads, per your Apache deck.
How do you check MySQL connectivity in PHP?
Use a script like <?php $conn = new mysqli(‘localhost’, ‘user’, ‘pass’, ‘mydb’); echo $conn->connect_error ?: ‘Connected’; ?>.
Tests WordPress database access. Freelancers verify connections, while enterprise architects log connection errors, per your PHP database deck.
What is a common LAMP error: “403 Forbidden”?
A 403 Forbidden error indicates Apache cannot access files due to permissions.
In WordPress, it’s fixed with chmod 755 or chown www-data. Freelancers troubleshoot permissions, while enterprise architects automate fixes, per your Linux basics.
How do you fix a “Database Connection Error” in WordPress?
Check wp-config.php credentials, MySQL service (sudo service mysql status), and user privileges.
Ensures WordPress connects to MySQL. Freelancers debug client issues, while enterprise architects monitor database availability, per your MySQL deck.
What is the role of libapache2-mod-php in LAMP?
libapache2-mod-php enables Apache to process PHP files.
Required for WordPress dynamic content. Freelancers install it, while enterprise architects ensure compatibility with PHP versions, per your PHP core concepts.
How do you secure the LAMP stack for WordPress?
Set file permissions, disable display_errors, secure MySQL users, and enable HTTPS.
Protects WordPress sites. Freelancers secure client setups, while enterprise architects enforce compliance, per your security decks.
What is mod_security in LAMP integration?
mod_security is an Apache firewall module to protect WordPress from attacks.
Blocks malicious requests. Freelancers enable it, while enterprise architects customize rules for enterprise security, per your Apache deck.
How do you enable SSL in LAMP for WordPress?
Install a certificate (e.g., Let’s Encrypt), enable mod_ssl, and configure <VirtualHost *:443> with SSLEngine on.
Secures WordPress with HTTPS. Freelancers set up SSL, while enterprise architects automate renewals, per your security and Apache decks.
What is a common LAMP error: “500 Internal Server Error”?
A 500 error indicates server issues, often due to .htaccess or PHP errors.
In WordPress, check /var/log/apache2/error.log. Freelancers debug logs, while enterprise architects monitor errors, per your error handling deck.
How do you troubleshoot slow WordPress performance in LAMP?
Optimize MySQL queries, enable PHP opcache, and configure Apache KeepAlive.
Improves WordPress speed. Freelancers tune performance, while enterprise architects scale resources, per your performance deck.
How do you back up a WordPress database in LAMP?
Use mysqldump -u root -p wp_database > backup.sql.
Saves WordPress data. Freelancers create backups, while enterprise architects automate them with cron, per your MySQL and Linux decks.
How do you deploy WordPress in a LAMP stack?
Install LAMP, create a MySQL database, configure wp-config.php, and place WordPress files in /var/www/html.
Sets up a WordPress site. Freelancers deploy for clients, while enterprise architects automate deployments, per your WordPress interests.
What is the role of php-mysql in LAMP?
The php-mysql module enables PHP to communicate with MySQL.
Essential for WordPress database queries. Freelancers install it, while enterprise architects ensure module compatibility, per your PHP database deck.