WordPress on LAMP Flashcards
(25 cards)
What is WordPress on a LAMP stack?
WordPress on LAMP is a WordPress installation running on Linux, Apache, MySQL, and PHP.
The LAMP stack provides a robust environment for WordPress, leveraging Linux for the OS, Apache for serving pages, MySQL for data, and PHP for logic. Freelancers deploy WordPress sites for clients, while enterprise architects scale LAMP for multi-site setups, aligning with your LAMP stack interest.
How do you install WordPress on a LAMP stack?
Download WordPress, extract to /var/www/html, create a MySQL database, and configure wp-config.php.
Installation involves placing files in Apache’s root and setting database credentials. Freelancers set up client sites, while enterprise architects automate deployments, building on your LAMP integration knowledge.
What is the role of wp-config.php in WordPress on LAMP?
wp-config.php configures WordPress’s database connection and settings, like define(‘DB_NAME’, ‘mydb’);.
Links WordPress to MySQL. Freelancers configure credentials, while enterprise architects secure file permissions (e.g., 644 chmod), per your PHP and security decks.
How do you create a MySQL database for WordPress?
Use CREATE DATABASE wp_database; and grant user privileges with GRANT ALL ON wp_database.* TO ‘wp_user’@’localhost’;.
Prepares the database for WordPress. Freelancers create secure users, while enterprise architects standardize database setups, per your MySQL deck.
How do you set file permissions for WordPress on 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 them, aligning with 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’s clean URLs via .htaccess. Freelancers enable permalinks, while enterprise architects optimize rewrites, per your Apache deck.
What is the .htaccess file’s role in WordPress on LAMP?
The .htaccess file enables URL rewriting for WordPress permalinks, like RewriteRule . /index.php [L].
Routes requests to WordPress. Freelancers configure it, while enterprise architects secure it against misuse, per your WordPress security deck.
How do you install PHP for WordPress in LAMP?
Use sudo apt install php libapache2-mod-php php-mysql, then restart Apache.
Enables PHP processing for WordPress. Freelancers ensure required modules, while enterprise architects select PHP versions (e.g., 8.2), per your PHP core concepts deck.
How do you test WordPress’s PHP setup in LAMP?
Create /var/www/html/info.php with <?php phpinfo(); ?> and access it via a browser.
Verifies PHP integration. Freelancers confirm setup, while enterprise architects restrict phpinfo() in production, per your security deck.
How do you secure wp-config.php in WordPress on LAMP?
Set permissions to chmod 600 wp-config.php and move it above the web root if possible.
Protects database credentials. Freelancers secure client sites, while enterprise architects enforce strict access, per your PHP security knowledge.
How do you enable SSL for WordPress on LAMP?
Install a certificate (e.g., Let’s Encrypt), enable mod_ssl, and configure <VirtualHost *:443> with SSLEngine on.
Secures WordPress with HTTPS. Freelancers use plugins like Really Simple SSL, while enterprise architects automate renewals, per your Apache and security decks.
What is the WordPress database prefix in LAMP?
The database prefix (e.g., wp_) identifies WordPress tables, set in wp-config.php as $table_prefix.
Enhances security by obscurity. Freelancers customize prefixes, while enterprise architects standardize them, per your MySQL deck.
How do you back up a WordPress database in LAMP?
Use mysqldump -u root -p wp_database > wp_backup.sql.
Saves WordPress data. Freelancers create backups, while enterprise architects schedule them with cron, per your database and Linux decks.
How do you restore a WordPress database in LAMP?
Use mysql -u root -p wp_database < wp_backup.sql.
Restores WordPress data. Freelancers recover sites, while enterprise architects automate restoration, per your database deck.
What causes a “403 Forbidden” error in WordPress on LAMP?
A 403 error occurs due to incorrect file permissions or Apache misconfiguration.
Fix with chmod 755 or chown www-data. Freelancers troubleshoot, while enterprise architects automate permission checks, per your LAMP integration deck.
What causes a “Database Connection Error” in WordPress on LAMP?
Answer: Incorrect wp-config.php credentials, MySQL downtime, or missing php-mysql cause connection errors.
Verify with mysql -u user -p. Freelancers debug issues, while enterprise architects monitor MySQL, per your MySQL and LAMP integration decks.
How do you optimize PHP for WordPress in LAMP?
Enable opcache in php.ini, increase memory_limit (e.g., 256M), and install php-mysql.
Boosts WordPress performance. Freelancers tune settings, while enterprise architects scale PHP resources, per your performance deck.
How do you enable debugging in WordPress on LAMP?
Set define(‘WP_DEBUG’, true); and define(‘WP_DEBUG_LOG’, true); in wp-config.php.
Logs errors to wp-content/debug.log. Freelancers debug plugins, while enterprise architects disable in production, per your error handling deck.
How do you configure Apache virtual hosts for WordPress?
Create /etc/apache2/sites-available/example.com.conf with <VirtualHost *:80> and enable with sudo a2ensite example.com.
Hosts WordPress sites. Freelancers configure hosts, while enterprise architects automate multi-site setups, per your Apache deck.
How do you secure WordPress uploads in LAMP?
Set wp-content/uploads permissions to 755, restrict file types in .htaccess, and use plugins like Wordfence.
Prevents malicious uploads. Freelancers secure client sites, while enterprise architects enforce restrictions, per your security deck.
What is the role of $wpdb in WordPress on LAMP?
$wpdb is WordPress’s database class for MySQL queries, like $wpdb->get_results(“SELECT * FROM wp_posts”);.
Interacts with the database. Freelancers use it in plugins, while enterprise architects secure queries, per your PHP database deck.
How do you optimize MySQL for WordPress in LAMP?
Add indexes, optimize tables with OPTIMIZE TABLE wp_posts;, and tune my.cnf (e.g., innodb_buffer_pool_size).
Speeds up WordPress queries. Freelancers enhance performance, while enterprise architects scale MySQL, per your MySQL deck.
How do you troubleshoot a “500 Internal Server Error” in WordPress on LAMP?
Check /var/log/apache2/error.log, verify .htaccess, and disable plugins to isolate issues.
Resolves server errors. Freelancers debug client sites, while enterprise architects monitor logs, per your error handling and LAMP integration decks.
How do you update WordPress in a LAMP environment?
Back up files and database, update via the admin dashboard, or replace core files manually.
Keeps WordPress secure. Freelancers manage updates, while enterprise architects automate updates for multi-site setups, per your security deck.